View source: R/build_figures.R
| write_figure | R Documentation | 
Takes a figure object, optionally stamps the image, and writes to a file dimensions of the figure.
write_figure(
  p_res = NULL,
  page = NULL,
  width = 3,
  height = 3,
  resolution = NULL,
  fig_file = NULL,
  fig_stamp = NULL,
  verbose = TRUE
)
p_res | 
 ggplot, ggforce paginated object, or ggarrange object.  | 
page | 
 Page number to write or NULL for a ggplot object.  | 
width | 
 Width in inches.  | 
height | 
 Height in inches.  | 
resolution | 
 resolution in dpi.  | 
fig_file | 
 File name to write the figure to.  | 
fig_stamp | 
 Character object containing the text to stamp on the figure with optional ===file=== placeholder.  | 
verbose | 
 Boolean variable when set to TRUE (default) messages will be. displayed on the terminal  | 
list with the following
"isgood" - Boolean variable indicating success or failure
"msgs" - Vector of messages
library(ggplot2)
write_figure(
 p_res = ggplot(),
 page = NULL,
 width = 3,
 height = 3,
 resolution = 200,
 fig_file = file.path(tempdir(), "write_figure_example.png"),
 fig_stamp = "stamp",
 verbose = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.