rk.graph.on {rkward}R Documentation

Copy device to HTML output

Description

Create or copy a device to a html page which is displayed as "output" in RKWard; accessible from Windows->Show Output. rk.graph.off closes the device that was opened by rk.graph.on. The default settings for device.type, width, height, and quality can be modified from Settings -> Configure RKWard -> Output.

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

a string, either "PNG" or "JPG" or "SVG" or NULL. In case of NULL, the default, "PNG", is used.

width,height

in pixels, the width and height of the copied device; default is 480 for both.

quality, ...

other arguments passed to the device function

Value

rk.graph.on invisibly returns the value of the corresponding device call, which, generally, is nothing.

rk.graph.off returns the number and name of the device that was active before rk.graph.on was called, whenever possbile. When not possible it returns the number and name of the next active device as done by dev.off.

Warning

Author(s)

Thomas Friedrichsmeier rkward-devel@lists.sourceforge.net

See Also

png, svg, dev.copy, dev.off, rkward://page/rkward_output

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.5.6 Index]