View source: R/opening_saving_Cairo.R
| saveGraphVisstat | R Documentation |
Closes all graphical devices with dev.off() and saves the output only
if both fileName and type are provided. Enhanced version that
can capture plots before closing devices.
saveGraphVisstat(
fileName = NULL,
type = NULL,
fileDirectory = getwd(),
oldfile = NULL,
capture_env = NULL
)
fileName |
name of file to be created in directory |
type |
see |
fileDirectory |
path of directory, where graphic is stored. Default setting current working directory. |
oldfile |
old file of same name to be overwritten |
capture_env |
Environment to store captured plots. If NULL, no capture occurs. |
NULL, if no type or fileName is provided, file path if graph
is created
# very simple KDE (adapted from example in Cairo())
openGraphCairo(type = "png", fileDirectory = tempdir())
plot(rnorm(4000), rnorm(4000), col = "#ff000018", pch = 19, cex = 2)
# save file 'norm.png' in directory specified in fileDirectory
saveGraphVisstat("norm", type = "png", fileDirectory = tempdir())
file.remove(file.path(tempdir(), "norm.png")) # remove file 'norm.png'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.