Removing outliers from a box-plot - ggplot2 - R

0 votes

I have made this box-plot on the iris data-set:

ggplot(data = iris,aes(x=Species,y=Sepal.Length))+geom_boxplot()
image


I would not want to display the outliers in this plot.

May 31, 2018 in Data Analytics by zombie
• 3,690 points
3,325 views

1 answer to this question.

0 votes

You just have to add 'outlier.shape=NA' inside the geom_boxplot() function:

I built this boxplot with the help of ggplot2:

ggplot(data = iris,aes(x=Species,y=Sepal.Length))+geom_boxplot(outlier.shape=NA)


image

answered May 31, 2018 by Bharani
• 4,550 points

Related Questions In Data Analytics

0 votes
1 answer

How to create a box-plot using “plotly” in R?

You can use this command to create ...READ MORE

answered Jul 4, 2018 in Data Analytics by CodingByHeart77
• 3,690 points
1,023 views
+1 vote
2 answers
0 votes
1 answer

Save a plot as image on the disk using R

Consider for both the situations: 1. Image will ...READ MORE

answered Apr 13, 2018 in Data Analytics by darklord
• 6,170 points
120 views
0 votes
4 answers

How to remove NA values from a Vector in R?

You can try na.omit() or na.exclude() too. ...READ MORE

answered Jul 31 in Data Analytics by anonymous
• 27,880 points
7,117 views
0 votes
1 answer

How to plot side-by-side Plots with ggplot2 in R?

By Using gridExtra library we can easily ...READ MORE

answered Apr 16, 2018 in Data Analytics by DeepCoder786
• 1,720 points
1,559 views
0 votes
1 answer

Aligning title in ggplot2

You can use the theme layer to ...READ MORE

answered Apr 27, 2018 in Data Analytics by Bharani
• 4,550 points
764 views
0 votes
1 answer

Making a ggplot2 plot without any legends,axes or axis labels

The below command will give you the ...READ MORE

answered May 29, 2018 in Data Analytics by Bharani
• 4,550 points
53 views
0 votes
0 answers
0 votes
1 answer

Changing the order of bars in a bar-plot - ggplot2 - R

You can use the scale_x_discrete() function with ...READ MORE

answered May 28, 2018 in Data Analytics by Bharani
• 4,550 points
3,010 views
0 votes
1 answer

Showing percentage instead of counts in a bar plot - ggplot2 - R

Load the 'scales' package first, which gives ...READ MORE

answered May 28, 2018 in Data Analytics by Bharani
• 4,550 points
1,349 views