plot_to_filename {rfigshare}R 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)

[Package rfigshare version 0.3.8 Index]