Skip to content

Instantly share code, notes, and snippets.

@keithmcnulty
Created September 1, 2020 10:49
Show Gist options
  • Select an option

  • Save keithmcnulty/3f564462dc5bde1cf7c00990d4c765ce to your computer and use it in GitHub Desktop.

Select an option

Save keithmcnulty/3f564462dc5bde1cf7c00990d4c765ce to your computer and use it in GitHub Desktop.
library(patchwork)
# generate scatter for entire dataset
p_all <- scatter_fn(penguins, bill_length_mm, bill_depth_mm, "All Species")
# get species scatters from penguin_scatters dataframe
for (i in 1:3) {
assign(paste("p", i, sep = "_"),
penguin_scatters$plot[i][[1]])
}
# display nicely using patchwork in R Markdown
p_all /
(p_1 | p_2 | p_3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment