I want to make multiple plots for each level of a factor or each value of a numeric variable (here each value of vs
variable). I do not want to use facet_grid
or facet_wrap
. I wonder if there is a more compact way to accomplish the task. In my actual data I do have many levels of a factor.
library(tidyverse)
mtcars %>%
dplyr::filter(vs == 0) %>%
ggplot(mapping = aes(x = wt, y = mpg)) +
geom_point()
mtcars %>%
dplyr::filter(vs == 1) %>%
ggplot(mapping = aes(x = wt, y = mpg)) +
geom_point()