View source: R/ggplot_lister.R
ggplot_list_saver | R Documentation |
Create and save sequential (or branching) ggplot figures
ggplot_list_saver( gglist, base.name, filetype = ".jpg", save.path = ".", suffix = "-V", niceties = NULL, ... )
gglist |
A list of ggplot layers, augmented with whole numbers to specify commands. First item in the list must be a |
base.name |
Name for plots (numbers will be added) without filetype. |
filetype |
suffix for file type, including period. Default is ".jpg" |
save.path |
Path to save files to. Default is current working directory. |
suffix |
Optional suffix to separate base name from plot numbers. Default is "-V". Set to "" to ignore. |
niceties |
A single ggplot layer or a list of ggplot layers that should be applied to all plots, and
are applied last. Common use case would be a list of axis labels, plot title, and theme. Defaults to NULL; in this case, no layers added.
Note that this formulation is merely for convenience – these layers can also be specified in gglist, but would generally need to be added before the first |
... |
Additional arguments passed to ggsave. Likely choices: width, height, units, dpi. See |
Logical
library(tidyverse) dat = data.frame(y = runif(30), x = runif(30)) # ggplot_list_saver(gglist = list(ggplot(data = dat, aes(x = x, y = y)), # geom_point(), 0, # geom_path(),0, -1, geom_smooth(method = 'lm')), # niceties = list(xlab("turtle"), ylab("cow"), theme_bw()), # base.name = "testfig", # save.path = "." # )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.