
Export ggplot2, gridExtra, or any plot object into rendered file
Source:R/other_plots.R
export_plot.RdExport any ggplot2, gridExtra, or any plot object
created with R into rendered png or jpg file.
Usage
export_plot(
p,
name = "plot",
vars = NA,
sep = ".vs.",
width = 8,
height = 6,
format = "png",
res = 300,
dir = getwd(),
subdir = NA,
quiet = FALSE
)Arguments
- p
Plot object. Plot to render and export.
- name
Character. File's name or suffix if vars is not
NA. No need to include file format on file name.- vars
Vector. Variable names to identify by filename.
- sep
Character. Separator for
vars.- width, height, res
Numeric. Plot's width, height, and res (for grids).
- format
Character. One of:
pngorjpeg.- dir, subdir
Character. In which directory/subdirectory do you wish to save the plot? Working directory as default
dir.- quiet
Boolean. Display successful message with filename when saved?
See also
Other Tools:
autoline(),
bind_files(),
bring_api(),
chr2num(),
db_download(),
db_upload(),
dont_sleep(),
export_results(),
files_functions(),
font_exists(),
formatColoured(),
formatHTML(),
glued(),
grepm(),
h2o_selectmodel(),
haveInternet(),
image_metadata(),
importxlsx(),
ip_data(),
json2vector(),
list_cats(),
listfiles(),
mail_send(),
markdown2df(),
move_files(),
msplit(),
myip(),
quiet(),
read.file(),
statusbar(),
tic(),
try_require(),
updateLares(),
warnifnot(),
what_size()