How to add a number of observations per group and use group mean in ggplot2 boxplot?
I am doing a basic boxplot where y=age and x=Patient groups age <- ggplot(data, aes(factor(group2), age)) + ylim(15, 80) age + geom_boxplot(fill = "grey80", colour = "#3366FF") I was hoping you could help me out with a few things: 1) Is it possible to include a number of observations per group above each group boxplot (but NOT on the X axis where my group labels are) without having to do this in paint :)? I have tried using: age + annotate("text", x = "CON", y = 60, label = "25") where CON is the 1st group and y = 60 is ~ just above the boxplot for this group. However, the command didn't work.