plot_to_filename function

Convienence function to save a ggplot2 plot, and return its filename.

Convienence function to save a ggplot2 plot, and return its filename.

plot_to_filename(plotobj, filename, path = ".")

Arguments

  • 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.

Returns

A file name, to use in fs_upload

Examples

## 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)

See Also

fs_upload