Skip to content

Instantly share code, notes, and snippets.

@ColinFay
Last active July 19, 2018 03:04
Show Gist options
  • Save ColinFay/52bc8727fa72d77cf9bb031acfdb808d to your computer and use it in GitHub Desktop.
Save ColinFay/52bc8727fa72d77cf9bb031acfdb808d to your computer and use it in GitHub Desktop.
library(patchwork)
library(ggplot2)
library(purrr)
library(dplyr)
library(glue)
map(
5:8,
~iris %>%
filter(Petal.Length < .x) %>%
ggplot() +
aes(Petal.Length, Sepal.Width, colour = Sepal.Length) +
geom_point(size = 6) +
scale_colour_gradientn(
colours = viridis::viridis(100),
limits = c(1, 8)
) +
labs(
title = glue("Filter on Petal.Length < {.x}")
)
) %>%
reduce(`+`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment