0

I'm interested in pre-computing boxplot information and passing the results to ggplot/geom_boxplot. That is, in a database or external process, determine the locations/breaks, quantiles and outliers and then bring that into R, and plot with ggplot2. I see that an analogous problem can be solved for histograms and bars geoms with geom_col()...

(taken from https://ggplot2.tidyverse.org/reference/geom_bar.html)

df <- data.frame(trt = c(1, 100, 300), outcome = c(2.3, 1.9, 3.2))
ggplot(df, aes(trt, outcome)) + geom_col()
csta
  • 2,423
  • 5
  • 26
  • 34
  • 3
    See the last example in the docs: https://ggplot2.tidyverse.org/reference/geom_boxplot.html#ref-examples. For the outliers you probably have to use an additional geom_point. – stefan Jun 15 '23 at 17:51

0 Answers0