ggplot2 - ggplot - Inline Subsetting for categorical variables - ggplot2 tutorial - ggplot tutorial
Here, we are subsetting the dataframe before passing it to ggplot. It is a very useful tool derived from the data frame data structure.
- To make the code more readable, one can also use dplyr's filter: