Convert a ggplot to a file in a temporary location, and return the file path. The file name will be based on the variable name of the object, and will be given an extension that corresponds to the method by which the file was saved. The 'device' (eg. "png" or "jpeg") is passed to the 'ggsave' function.
1 | ggplot_to_file(gg, file_format = "png", file_name = NULL, ...)
|
gg |
A ggplot to be converted into a file. |
file_format |
An argument passed onto the ggsave function that determines how the plot is saved. It is recommended to use either "png" or "jpeg". Defaults to "png". |
file_name |
Sets the name of the saved file, without the extension. If this isn't provided, the name of the 'data' variable will be used. "." is a forbidden 'file_name' for this function, and is usually provided by a pipe ( string of random numbers. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.