I tried with the "solutions" from other posts without success. So, I am trying to add to my ggplot2 barplot the sample size per group under the names at the x-axis. I am using the stat_n_text(), but it does not allow you to change the position outside the chart. Does anyone know how to do this, or is there any other approach to adding the sample size per group?
Here is my code and my output.
ggplot(data, aes(group, pm_l, fill=condition)) + theme_classic() +
geom_bar(position = position_dodge(), stat = "identity") +
facet_wrap(~parameter, scales = "free") +
ylab("pm_l") +
scale_fill_brewer(palette = "Paired") +
stat_n_text(y.pos = 0)
I want the n=X to be named MICRO and ONE in each plot.
Any help or suggestions are highly appreciated!!!!