1

how do I change outlier rules in geom_boxplot? In boxplot, I just need to set range = 3. Also, how do I set lower and upper?

individual_SoA_plots <- lapply(individual_SoA_data,
                              function(x) {
                                ggplot(x, aes(x = x$GROUP, y =x$AgingOfAlert)) +
                                  geom_boxplot(ymin = 0, ymax = 162,
                                               col=" dark blue", fill = "green",
                                               outlier.colour = "#1F3552", outlier.shape = 20) +
                                  scale_y_continuous(name = "Aging Of Alerts") +
                                  scale_x_discrete(name = "Current State", limits = GROUPtype) +
                                  ggtitle(x$SourceOfAlert[1]) + theme_bw() +
                                  theme(text = element_text(size=10))
                              })
pogibas
  • 27,303
  • 19
  • 84
  • 117
Cloud Li
  • 11
  • 4
  • 2
    Possible duplicate of [Changing the outlier rule in a boxplot](https://stackoverflow.com/questions/4994313/changing-the-outlier-rule-in-a-boxplot) – pogibas Oct 17 '17 at 19:52
  • No, it is not, I am asking geom_boxplot, which does not have "range" – Cloud Li Oct 17 '17 at 19:58

1 Answers1

4

Look into the coef argument for geom_boxplot(). It defaults to 1.5 and sets the length of whiskers based on coef and the inter-quartile range, with all points outside whiskers considered outliers.

dtsavage
  • 359
  • 1
  • 14