View source: R/Visualizations_general.R
save_ggplot_list | R Documentation |
This function takes a list of ggplot figures and saves them as a patchwork to a file specified by a base path and filename, split into multiple files if the list is longer than a given split N.
save_ggplot_list(
ggLS,
basepath,
filename,
splitN = 20,
width = 12,
height = 7,
units = "in",
dpi = 150
)
ggLS |
A list of ggplot figures. |
basepath |
The base path for the output file. |
filename |
The name of the output file, not including any extension. |
splitN |
The number of ggplots to include in each patchwork file (default is 20). |
width |
The width of the output file in inches (default is 12). |
height |
The height of the output file in inches (default is 7). |
units |
The units of the output file (default is "in"). |
dpi |
The resolution of the output file in dots per inch (default is 150). |
## Save a list of ggplot figures to a file
my_ggplots <- list(ggplot(data = mtcars, aes(x = mpg, y = wt)) + geom_point(),
ggplot(data = iris, aes(x = Sepal.Length, y = Sepal.Width)) + geom_point())
save_ggplot_list(ggLS = my_ggplots, basepath = "/path/to/file", filename = "my_ggplots")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.