rk.graph.on {rkward}R Documentation

Plot graphics to HTML output file

Description

rk.graph.on() creates an R device that will plot to the output html page in RKWard (rkward://page/rkward_output). The default settings for device.type, width, height, and quality can be modified from Settings -> Configure RKWard -> Output.

rk.graph.off() closes the device that was opened by rk.graph.on.

Usage

  rk.graph.on(device.type = getOption("rk.graphics.type"),
    width = getOption("rk.graphics.width"),
    height = getOption("rk.graphics.height"), quality, ...)

  rk.graph.off()

Arguments

device.type

Type of device to create / graphics format to use. Currently, supported devices are "PNG", "SVG", or "JPG". The default is to use the format configured in Settings -> Configure RKWard -> Output.

width

Width of graphics in pixels. The default is to use the width configured in Settings -> Configure RKWard -> Output.

height

Height of graphics in pixels. The default is to use the heigth configured in Settings -> Configure RKWard -> Output.

quality

For device.type "JPG", quality of the JPG file from 0 to 100. The default is to use the quality configured in Settings -> Configure RKWard -> Output.

...

Further options will be passed to the graphics device used internally.

Warning: It is advised to use rk.graph.off and not dev.off to close the device opened by rk.graph.on. dev.print(device = rk.graph.on) is a wrong usage for this "device," and will result in errors.

Author(s)

Thomas Friedrichsmeier rkward-devel@lists.sourceforge.net

See Also

rk.results rk.print rk.get.output.html.file dev.off svg png jpg

Examples

require (rkward)

## Plot directly to the output (html) file, by-passing screen device:
rk.graph.on ("JPG", 480, 480, 75)
plot (rnorm (100))
rk.graph.off ()

## Copy the displayed plot to the output:
plot (rnorm (100))
dev.copy (device = rk.graph.on)
rk.graph.off ()

## WRONG USAGE: not run:
#plot (rnorm (100))
#dev.print (device = rk.graph.on)

[Package rkward version 0.6.1 Index]