Skip to content

displaying multiple plots on a xaringan slide #17

@TheTroyF

Description

@TheTroyF

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions