0

I am trying to Boxplot my data frame using this command.

ggplot(combined_data,aes(x= factor(field), y=moisture1))+geom_boxplot()

How can I remove the outliers from the output of this command ?

XCeptable
  • 1,247
  • 6
  • 25
  • 49

1 Answers1

2

If you just want to remove the outliers from your graph, you can just add the argument outlier.shape = NA to geom_boxplot()

Example:

require(tidyverse)

mtcars %>% 
  ggplot(aes(1, wt)) + 
  geom_boxplot(outlier.shape = NA)
Z.Lin
  • 28,055
  • 6
  • 54
  • 94
DJV
  • 4,743
  • 3
  • 19
  • 34