Rev 49852 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/grid/man/grid.record.Rd% Part of the R package, http://www.R-project.org% Copyright 1995-2007 R Core Development Team% Distributed under GPL 2 or later\name{grid.record}\alias{grid.record}\alias{recordGrob}\title{ Encapsulate calculations and drawing }\description{Evaluates an expression that includes both calculationsand drawing that depends on the calculations so thatboth the calculations and the drawing will be rerun whenthe scene is redrawn (e.g., device resize or editing).Intended \emph{only} for expert use.}\usage{recordGrob(expr, list, name=NULL, gp=NULL, vp=NULL)grid.record(expr, list, name=NULL, gp=NULL, vp=NULL)}\arguments{\item{expr}{object of mode \code{\link{expression}} or \code{call} oran unevaluated expression.}\item{list}{a list defining the environment in which \code{expr} is tobe evaluated.}\item{name}{ A character identifier. }\item{gp}{An object of class \code{gpar}, typically the outputfrom a call to the function \code{gpar}. This is basicallya list of graphical parameter settings.}\item{vp}{A Grid viewport object (or NULL).}}\details{A grob is created of special class \code{"recordedGrob"}(and drawn, in the case of \code{grid.record}).The \code{drawDetails} method for this classevaluates the expression with the list as the evaluationenvironment (and the grid Namespace as the parent of thatenvironment).}\author{ Paul Murrell }\note{ This function \emph{must} be used instead of thefunction \code{recordGraphics}; all of the dire warningsabout using \code{recordGraphics} responsibly also apply here.}\seealso{ \code{\link{recordGraphics}} }\examples{grid.record({w <- convertWidth(unit(1, "inches"), "npc")grid.rect(width=w)},list())}\keyword{ dplot }