I am running the following line of code
bp <- ggplot(data, aes(x = Month, y = days, group = Month)) + geom_boxplot()+facet_wrap(~Depth)
which works fine and produces a plot of 3 graphs of 3 different Depths each containing a boxplot for each month (I can't post an img
of it yet)
However, I would like to display them on a single graph with Depth colour coded for the 3 variables (25, 100, and 300). How would I achieve this? my data look like this
depth month days
25 1 49
25 1 51
100 1 52
100 1 55
300 1 52
300 1 50
25 2 47
25 2 48
100 2 53
100 2 57
300 2 56
300 2 59
... ... ...
If this is a duplicate question I apologise but the questions I looked at didn't seem to fit my needs I have tried using
bp + geom_boxplot(position = position_dodge(width = 0.8))
as suggested here but didn't create one graph
thanks