Let's say, you want to do split up your data by one or more variables and plot the subsets of data together. This can be achieved by facetting or facet. A minimum reproducible example is given below;
library(ggplot2)
mpg_data <- as.data.frame(mpg)
ggplot(data = mpg_data[1:10,], aes(x = cty, y = cyl)) +
geom_point()+
facet_wrap(~model)
Let's say, you want to do split up your data by one or more variables and plot the subsets of data together. This can be achieved by
facettingorfacet. A minimum reproducible example is given below;