Convienence function to save a ggplot2 plot, and return its filename.
plot_to_filename(plotobj, filename, path = ".")
plotobj
: ggplot2 plot object (should add support for base plots too)filename
: Filename, don't include the file type extension.path
: Path where you want to save the file.A file name, to use in fs_upload
## Not run: # include in your fs_upload call library(ggplot2) p <- qplot(mpg, wt, data=mtcars) plott <- fs_create(title="my title", description="some description", type="figure") fs_add_categories(plott, "Ecology") fs_upload(plott, plot_to_filename(p, "myfilename", "~")) ## End(Not run)
fs_upload
Useful links