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
1,990 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,680 points
617 views
+1 vote
1 answer

Finding number of missing values and removing those missing values from a data-frame

This code gives the total number of ...READ MORE

answered Mar 27, 2018 in Data Analytics by Bharani
• 4,550 points
26 views
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,140 points
64 views
0 votes
3 answers

How to remove NA values from a Vector in R?

using the function "complete.cases" for example, if you ...READ MORE

answered Jun 18 in Data Analytics by anonymous
4,536 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,700 points
1,144 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
587 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
37 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
1,823 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,029 views