grid.record {grid} | R Documentation |
Evaluates an expression that includes both calculations and drawing that depends on the calculations so that both the calculations and the drawing will be rerun when the scene is redrawn (e.g., device resize or editing).
Intended only for expert use.
recordGrob(expr, list, name=NULL, gp=NULL, vp=NULL)
grid.record(expr, list, name=NULL, gp=NULL, vp=NULL)
expr |
object of mode |
list |
a list defining the environment in which |
name |
A character identifier. |
gp |
An object of class |
vp |
A Grid viewport object (or NULL). |
A grob is created of special class "recordedGrob"
(and drawn, in the case of grid.record
).
The drawDetails
method for this class
evaluates the expression with the list as the evaluation
environment (and the grid Namespace as the parent of that
environment).
This function must be used instead of the
function recordGraphics
; all of the dire warnings
about using recordGraphics
responsibly also apply here.
Paul Murrell
recordGraphics
grid.record({
w <- convertWidth(unit(1, "inches"), "npc")
grid.rect(width=w)
},
list())