Takes arguments similar to ggplot2::ggsave() and creates a temporary plot file (png) to be used as input to card_widget().

gg_preview(gg, width = 350/72, height = 196/72, dpi = "retina")

Arguments

gg

ggplot2 plot object

width, height

width and height of the preview image. See References for guidelines

dpi

see ggplot2::ggsave()

Value

path to the preview image tempfile

References