How To Reorder a Boxplot in R? Hint: Use forcats

reorder boxplot R

Sometimes, when one is making boxplot with ggplot2, one might like to order the boxes in a boxplot in a specific way. For example, one might want to sort the boxes in boxplot in ascending or descening order based on the mean or median values of groups in the boxplot. Reordering boxplots can reveal the… Continue reading How To Reorder a Boxplot in R? Hint: Use forcats

ggplot2 Version 3.0.0 Brings Tidy Evaluation to ggplot

RStudio has unveiled major updates to ggplot2 with new version 3.0.0. The new ggplot2 version is available on CRAN about two weeks ago. ggplot2 3.0.0 was originally announced as ggplot2 2.3.0, but big updates made RStudio to bump the version number to 3.0.0. One of the biggest additions in the new version is that ggplo2… Continue reading ggplot2 Version 3.0.0 Brings Tidy Evaluation to ggplot

How to Make Boxplot in R with ggplot2?

Boxplot with jittered Data Points in R

One of many strengths of R is the tidyverse packages and the ability to make great looking plots easily. Boxplot or Box and Whisker plot, introduced by John Tukey is great for visualizing data from multiple groups/ distributions. Boxplot allows you to actually display the data together with efficient summary of the data using min,… Continue reading How to Make Boxplot in R with ggplot2?

Why can’t ggplot2 use %>% instead of “+”?

Have you ever mixed up dplyr’s pipe operator or magittr %>% with ggplot’s “+” while piping dplyr commands with ggplot2, you are not alone. Depending on where you misused “%>%” for “+”, you might get confusing errors like Error: Mapping must be created by `aes()` or `aes_()` Error in as.vector(x, “character”) : cannot coerce type… Continue reading Why can’t ggplot2 use %>% instead of “+”?