Hi everyone
I want to draw a boxplot with three x-axis label levels. I have a dataframe named mydata likes following (8 Culvivars, 2 species, 2 origin levels,)
Cultivar Species Origin Treatment Growth
M DS Me CT 23
M DS Me TM 13
N DS Me CT 32
N DS Me TM 32
B DS Col CT 12
B DS Col TM 21
R DS Col CT 21
R DS Col TM 23
E CF Me CT 23
E CF Me TM 31
L CF Me CT 21
L CF Me TM 21
H CF Col CT 12
H CF Col TM 24
D CF Col CT 34
D CF Col TM 22
I want to create a bar chart with y axis is height, x axis presents three levels includes Species, Origin and Cultivar (group by Species and then origin)
I have tried with command:
ggplot(mydata, aes(x=Cultivar, y=Growth, fill=Treatment) + geom_boxplot() + facet_wrap(~Species, scales="free_x")
By doing this, I could draw a boxplot grouped by species. However, I have no idea how to split by Origin.
Your idea is really appreciated!
Thank you very much!
Kind regards,