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

View source: R/plot_to_filename.R

plot_to_filenameR Documentation

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

Description

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

Usage

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.

Value

A file name, to use in fs_upload

See Also

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)

rfigshare documentation built on May 10, 2022, 1:05 a.m.