I am using the ggscatter function in the ggpubr package in R. See following code using the ToothGrowth dataset as an example:
library("ggpubr")
ggscatter(ToothGrowth, x = "dose", y = "len",
color = "supp", facet.by = "supp")
I would like to add the sample sizes (n) to the facet labels, so that they read: "OJ (n=30)" and "VC (n=30)". I assume that I need to use "panel.labs". Instructions say:
panel.labs = list(sex = c("Male", "Female"), rx = c("Obs", "Lev", "Lev2")
But I am not able to modify this to get where I hope to get. It also was not clear what "rx" means. Any suggestions would be terrific. Thank you.
Edit
Thanks for your answers below. I would like to clarify that I would like to include the "n=30" in the code, so that the '30' is automatically added from the data, not just as a text label saying 'n=30'. I need to do this at a larger scale, on which it is not possible to add each individually as text. Apologies for not being clearer in my initial question. Thank you.