Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data(mtcars)
- library(tidyverse)
- mtcars_split <-
- mtcars %>%
- split(mtcars$cyl)
- plots <- map2(
- mtcars_split,
- names(mtcars_split),
- ~ggplot(data = .x, mapping = aes(y = mpg, x = wt)) +
- geom_jitter() +
- ggtitle(.y)+
- scale_y_continuous(limits=c(max(.y)/2,NA))
- )
- plots
Add Comment
Please, Sign In to add comment