ich möchte im Rahmen meiner Masterarbeit ein Boxplotdiagramm mit ggplot erstellen. Mit der Standardfunktion bekomme ich die Anordnung ohne Probleme so hin, wie ich es mir vorstelle, bloß mit ggplot nicht. Wie bekomme ich die Boxplots von 3 verschiedenen Variablen (Gewicht.t0, Gewicht.t2 und Gewicht.t3) nebeneinander mit einer gemeinsamen y-Achse?
So solls aussehen:
Code: Alles auswählen
boxplot(gesamt$Gewicht.t0,gesamt$Gewicht.t2,gesamt$Gewicht.t3, main ="Gewicht zum Zeitpunkt t0, t2 und t3", ylab = "Gewicht in kg")
So siehts aus mit ggplot:
Code: Alles auswählen
ggplot(data = gesamt) +
geom_boxplot(aes(x = Gewicht.t0, y = Gewicht.t0)) +
geom_boxplot(aes(x = Gewicht.t2, y = Gewicht.t2)) +
geom_boxplot(aes(x = Gewicht.t3, y = Gewicht.t3))
Hoffe, mir kann jemand helfen.
Viele Grüße
Tina