webPNG | R Documentation |
webPNG
sets up a bitmap graphics device for graphs drawn within
a CGI script.
webPNG(file, ..., graphDir)
file |
A filename, as a character string |
... |
Any other arguments to |
graphDir |
the name of the directory in which to create the
image file. If this is missing, the global variable
of the same name is used. This argument therefore allows one
to use a value specific to an individual call. See
|
Before webPNG
is called, the variable
graphDir
must be a character string giving the location
where graphics files will be written by R and found by the web server.
The directory specified in graphDir
must be writeable and
readable by the web server in order to work. For example, if
graphDir
is "/users/david/public_html/graphs/"
(note
the trailing /
!), and if file
is "mygraph.png"
,
the next graph will be written to
"/users/david/public_html/graphs/mygraph.png"
, provided that
/users/david/public_html/graphs
has suitable permissions.
None (invisible(NULL)
)
David Firth d.firth@warwick.ac.uk
img
## Not run:
graphDir <- "/users/david/public_html/graphs/"
webPNG("mygraph.png")
## then do whatever plotting is required...
# Or, creating a JPEG image and specifying the output directory
# in the call rather than via the global variable.
webPNG("mygraph.png", type = "jpeg", graphDir = "/users/david/public_html/graphs/")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.