rgl (version 0.95.1367)

rgl.Sweave: Integrating rgl with Sweave

Description

As of R2.13.0, it is possible to include rgl graphics into a Sweave document. These functions support that integration.

Usage

Sweave.snapshot()
rgl.Sweave(name, width, height, options, ...)
rgl.Sweave.off()

Arguments

name, width, height, options, ...
These arguments are passed by Sweave to rgl.Sweave when it opens the device.

Value

  • These functions are called for their side effects.

Details

The rgl.Sweave function is not normally called by the user. The user specifies it as the graphics driver when opening the code chunk, e.g. by using

<>=

When the rgl device is closed at the end of the code chunk, rgl.Sweave.off() will be called automatically. It will save a snapshot of the last image (by default in .png format) for inclusion in the Sweave document and (by default) close the device. Alternatively, the Sweave.snapshot() function can be called to save the image before the end of the chunk. Only one snapshot will be taken per chunk.

Several chunk options are used by the rgl.Sweave device: [object Object],[object Object],[object Object]

See Also

RweaveLatex for a description of alternate graphics drivers in Sweave, and standard options that can be used in code chunks.

hook_rgl and hook_webgl allow fixed or interactive rgl scenes to be embedded in knitr documents.