How to Remove Outliers from Boxplot using ggplot2 in R

This tutorial will go through how to remove outliers from a boxplot using ggplot2 in R with the help of code examples. Table of contentsExampleRemove Outlier Using outlier.shape=NASummary Example In the following example, we are going to use the iris dataset to create...

How to Rotate and Space Axis Labels in ggplot2 with R

You can rotate the axis labels by using angle parameter of the element_text() function when modifying the theme of your plot, for example: theme(axis.text.x = element_text(angle = 90, vjust = 0.5) We can use vjust and hjust in element_text() to add horizontal and...

How to Order Bars in ggplot2 Bar Graph with R

This R tutorial will go through how to order bars in a ggplot2 bar chart with code examples. Table of contentsExampleSolution #1: Manually Order BarsSolution #2: Sort Bars in Descending OrderSolution #3: Sort Bars in Ascending OrderSummary Example Consider the...