This function provides a simple interface to export figures generated in R to multiple formats.
1 2 3 4 5 6 7 8 9 10 11 |
figure |
the graphics to be exported. |
filename |
a string which the name of the figure to be exported |
widthpx |
an integer which specifies the width of the exported figure in pixels |
heightpx |
an integer which specifies the height of the exported figure in pixels |
res |
an integer which specifies the resolution of the exported figure for png. |
format |
a character vector which specifies the exported format(s). Currently supports "png" and "pdf". |
dir |
a character string which specifies the directory that the figure will be exported, relative to the current working directory. If the directory does not exist, it will be created. |
prefix |
a character string which specifies the time of prefix. "date" specifies the current date, "time" prefixes both the date and time to the filename, and NULL removes the prefix altogether. |
replace |
a logical value. If set to TRUE, files with the same file name will be overwritten on export. If set to FALSE, the software will check for duplicate filenames and append a padded integer to the filename to avoid overwriting. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.