Cloud Li
Cloud Li

Reputation: 11

geom_boxplot: change outlier rules

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))
                              })

Upvotes: 1

Views: 2389

Answers (1)

dtsavage
dtsavage

Reputation: 359

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.

Upvotes: 4

Related Questions