-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
This is my slide, it's meant to show how you can replicate data in multiple plots by using a function in r. The issue is, I can't fit multiple plots on one slide unless I make them very small.
class: center, inverse
Functional Programming
Rstudio treats all GGplot objects the same as regular r objects. You can add multiple geoms to the same base plot, giving you the user, a quick reference to multiple different visuals.
geoms <- list(
geom_point(),
geom_boxplot(aes(group = cut_width(displ, 1))),
list(geom_point(), geom_smooth())
)
p <- ggplot(mpg, aes(displ, hwy))
lapply(geoms, function(g) p + g)
Metadata
Metadata
Assignees
Labels
No labels