#' Save a picture into the temp directory.
#'
#' @return the path to the picture (using the website)
#' @author Barret Schloerke
#' @keywords internal
save_picture <- function(obj_name, obj_plot) {
file_path <- file.path(tempdir(), str_c(obj_name, ".png", collapse = ""))
# only make the picture if you have to
# duplicates do not exist as naming should be done well
if(!file.exists(file_path)) {
png(file_path)
on.exit(dev.off())
print(obj_plot)
}
str_c("/picture/", obj_name, ".png", collapse = "")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.