0

I have plotted a grouped Boxplot using ggplot with the code below:

ggplot(Data, `aes(x=Date$Result,y=Data$delta,fill=Data$ID))+geom_boxplot()+xlab("asdf")+ylab("fdsa")+guides(fill=guide_legend(title = "Results"))`

I would like to have a summarized (grouped) statistics containing mean, median, sd etc. as text displayed below the boxplot, how should I do that?

stefan
  • 90,330
  • 6
  • 25
  • 51
Olivia
  • 45
  • 6
  • Not sure if this is what you need but I have used this for my graphs: https://www.datanovia.com/en/blog/how-to-create-a-beautiful-plots-in-r-with-summary-statistics-labels/ –  Jul 05 '21 at 17:07
  • it is exactly what I want but I don't have rstatix and ggpubr installed right now on my computer it is also not possible to install them for now....:( – Olivia Jul 05 '21 at 17:14
  • Are you able to share a MRE? https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Skaqqs Jul 06 '21 at 15:30
  • Hi @Skaqqs thanks for your reply. Because the task was urgent, I had to find some other solutions: I directly did a summary of this dataset with mean and median and so on. I think my problem can be solved easily with some packages, but I work in a closed environment for security reason... – Olivia Jul 07 '21 at 10:49
  • 1
    For posterity: https://stackoverflow.com/questions/10014187/displaying-text-below-the-plot-generated-by-ggplot2 https://stackoverflow.com/questions/28755576/add-text-to-ggplot https://stackoverflow.com/questions/63553077/adding-summary-statistics-to-a-graph-using-the-annotation-feature-ggplot2 – Skaqqs Jul 07 '21 at 12:15

0 Answers0