I'm trying to add a geom_smooth()
trend to some a boxplot graph, but am not getting the layers correctly.
How can I merge these two together?
geom_boxplot:
ggplot(test) + geom_boxplot(aes(x=factor(year), y = dm))
geom_smooth
ggplot(test, aes(year, dm)) + geom_smooth()
Both geom_boxplot and geom_smooth
ggplot(test) + geom_boxplot(aes(x=factor(year), y = dm)) + geom_smooth(aes(x = year, y = dm))