RGraph(expr, substitute = TRUE, width = deviceArgs[["width"]], height = deviceArgs[["height"]], data = NULL, envirData = parent.frame(), graphicsDevice = "png", deviceArgs = list(), packages = getOption("RGraphPackages"), verbose = FALSE, display = FALSE, file = NULL, returnFilename = FALSE, viewer = if (graphicsDevice == "win.metafile") browseURL else getOption("viewer", default=browseURL), REvaluator. = RinR::REvaluator)
expr | an expression that produces the desired graphic. |
substitute | a logical value. If TRUE (the default), treat the expr argument as a literal expression. If FALSE, treat it as something that evaluates to the expression to pass to the remote open-source R process. |
width | an integer giving the width of the graphic to create. The units depend on the graphicsDevice. png and jpg use pixels while pdf and win.metafile use inches. |
height | an integer giving the height of the graphic to be created. The units depend on the graphicsDevice. |
data | if not NULL, then either a character vector or a named list specifying the objects to add into the environment where expr is evaluated. If NULL, then names in the expression, expr, that are not used as function calls are assumed to be data objects that should be sent to the plotting evaluator. Use data=character() or data=list() to cause it to not look through expr and to not send any data objects. |
envirData | an environment. If the data argument is a character vector naming data objects, the names are looked up in this environment. |
graphicsDevice | a character string specifing the R function that produces the desired graphics file format: "png", "pdf", "jpeg", or, only on Windows, "win.metafile" (Windows metafile). |
deviceArgs | a list with names listing the arguments to pass to the graphicsDevice. The width and height arguments are generally passed separately, but you can use them here if you use their full names. |
packages | a character vector identifying any packages that must be loaded before expr is evaluated. |
verbose | a logical value. If TRUE print some debugging information. The default is FALSE. |
display | a logical value. If TRUE, then the graphic is displayed using the function given as the viewer argument. In that case, the graphics file is not removed when the function is done. The default is FALSE. |
file | a character string naming the graphics file. If NULL (the default value), a temporary file with a file extension appropriate to the file format is used. If a file name is supplied then the file is not removed when the function finishes. |
returnFilename | a logical value. If FALSE (the default), returns, as a raw vector, the bytes in the file. If TRUE, returns the name of the file. In the latter case, the file is not removed when the function is done. |
viewer | a function that takes a name of a graphics file for an argument and displays the graphics in the file. The function browseURL works well for all supported file formats. In RStudio version 0.98.447, getOption("viewer") is a good choice, except for .wmf files. |
REvaluator. | an REvaluator function for a version of open-source R that can produce graphics. Spotfire Enterprise Runtime for R currently cannot produce graphics. |
## Not run: library(Sdatasets) ### basic plot RGraph(hist(fuel.frame$Disp.), data = "fuel.frame", display = TRUE)### basic plot, sending data under a new name RGraph(hist(ff$Disp.), data=list(ff = Sdatasets::fuel.frame), display = TRUE)
### image in jpeg format, let Rgraph figure out which dataset needs to be sent grFile <- RGraph(image(voice.five), graphicsDevice="jpeg", deviceArgs=list(pointsize=20), display=TRUE, returnFile = TRUE) unlink(grFile) # clean up when done looking at the file
### use lattice package (so must use print() to make the plot). ### Since xyplot() includes data argument, RGraph does not try ### to send over the vectors named in its formula argument. RGraph(print(xyplot(Fuel ~ Weight | Type, data=fuel.frame)), packages="lattice", display = TRUE) ## End(Not run)