Skip to contents

Takes a ggplot and saves a zip file with a single csv file for each layer of the plot with the data used by said layer

Usage

save_plot_data(plot, name = "plot", dir = ".")

Arguments

plot

A ggplot2 plot.

name

The name used as file name.

dir

Directory where to put the file. If NUL

In general, you don't need to call this function explicitly, since it will be used automatically by knitr if the plot data directory is set (see save_plot_data_in()).

Paraphrasing Voltaire, if dir doesn't exist, it will be created. If the file already exists, it will be overwritten without a warning. This is because this function is supposed to run with knitr every time a document is knit and will update the data to the latest version.