how can I separate the text annotations inserted by geom_text in the following boxplots?
data(mtcars)
ggplot(data = mtcars, aes(as.factor(vs), mpg, color = am )) +
facet_wrap(~gear) +
geom_boxplot() +
geom_text(data=mtcars, aes(x=0.7, y = 30, label=carb), parse=TRUE)
This is just an example, not the real problem I have. In my specific case, the text annotations indicate the amount of observations in the respective group. They come from an aggregate function. At the end I would like to have faceted boxplots as in the example, with the respective number of observations above each respective boxplot.