webPNG {CGIwithR}R Documentation

A Wrapper for the ‘bitmap’ Graphics Device

Description

webPNG sets up a bitmap graphics device for graphs drawn within a CGI script.

Usage

webPNG(file, ..., graphDir)

Arguments

file A filename, as a character string
... Any other arguments to bitmap
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 img also.

Details

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.

Value

None (invisible(NULL))

Author(s)

David Firth d.firth@warwick.ac.uk

See Also

img

Examples

## 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)

[Package CGIwithR version 0.72 Index]