ggsave_ext | R Documentation |
Save a plot or map then update the EXIF metadata for the title, author, and
create data. ggsave_ext()
also supports creating a file name based on a
sentence case name with spaces (e.g. "Baltimore city map") and appending a
label (e.g. "baltcity") as a prefix to the output file name.
ggsave_ext( plot = ggplot2::last_plot(), name = NULL, label = NULL, prefix = NULL, postfix = NULL, filename = NULL, device = NULL, filetype = NULL, path = NULL, paper = NULL, orientation = "portrait", width = NULL, height = NULL, units = "in", scale = 1, dpi = 300, bgcolor = NULL, exif = FALSE, title = NULL, author = NULL, keywords = NULL, args = NULL, ... ) ggsave_social( plot = ggplot2::last_plot(), image = "Instagram post", platform = NULL, format = NULL, orientation = NULL, name = NULL, filename = NULL, filetype = "jpeg", dpi = 72, width = 1080, height = 1080, units = "px", ... ) gtsave_ext( gt_object, name = NULL, label = NULL, prefix = NULL, postfix = NULL, filename = NULL, filetype = NULL, path = NULL, ... )
plot |
Plot to save, defaults to last plot displayed. |
name |
Plot name, used to create filename (if filename is |
label |
Label to combine with name converted to snake case with
|
prefix |
File name prefix. "date" adds a date prefix, "time" adds a
date/time prefix; defaults to |
postfix |
File name postfix; defaults to |
filename |
File name to create on disk. |
device |
Device to use. Can either be a device function (e.g. png), or one of "eps", "ps", "tex" (pictex), "pdf", "jpeg", "tiff", "png", "bmp", "svg" or "wmf" (windows only). |
filetype |
File type or extension. |
path |
Path of the directory to save plot to: |
paper |
Paper matching name from |
orientation |
Page orientation ("portrait", "landscape", or "square"). |
width, height, units |
Plot size in |
scale |
Multiplicative scaling factor. |
dpi |
Plot resolution. Also accepts a string input: "retina" (320), "print" (300), or "screen" (72). Applies only to raster output types. |
bgcolor |
Background color to optionally override |
exif |
If |
title |
Title to add to file metadata with exiftoolr, Default: |
author |
Author to add to file metadata with exiftoolr, Default: |
keywords |
Keyword(s) added to file metadata with with exiftoolr,
Default: |
args |
Alternate arguments passed to |
... |
Additional parameters passed to |
image |
Image size name, Default: |
platform |
Social media platform, "Instagram", "Facebook", or "Twitter",
Default: |
format |
Image format, "post", "story", or "cover", Default: |
gt_object |
A gt table to save to file. |
The gtsave_ext wraps the equivalent function gt::gtsave()
with a similar
structure for creating custom file names. This function does not currently
support EXIF metadata updates although this option may be added in the future.
ggplot2::ggsave()
## Not run: ggplot2::ggplot() + layer_location_data( data = system.file("shape/nc.shp", package = "sf") ) ggsave_ext( name = "counties", label = "North Carolina", device = "pdf", paper = "letter" ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.