EVOLUTION-MANAGER
Edit File: grid.DLapply.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Modify the Grid Display List</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for grid.DLapply {grid}"><tr><td>grid.DLapply {grid}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Modify the Grid Display List </h2> <h3>Description</h3> <p>Call a function on each element of the current display list. </p> <h3>Usage</h3> <pre> grid.DLapply(FUN, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>FUN</code></td> <td> <p>A function; the first argument to this function is passed each element of the display list. </p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Further arguments to pass to <code>FUN</code> .</p> </td></tr> </table> <h3>Details</h3> <p>This function is insanely dangerous (for the grid display list). </p> <p>Two token efforts are made to try to avoid ending up with complete garbage on the display list: </p> <ol> <li><p> The display list is only replaced once all new elements have been generated (so an error during generation does not result in a half-finished display list). </p> </li> <li><p> All new elements must be either <code>NULL</code> or inherit from the class of the element that they are replacing. </p> </li></ol> <h3>Value</h3> <p>The side effect of these functions is usually to modify the grid display list. </p> <h3>See Also</h3> <p><a href="Grid.html">Grid</a>. </p> <h3>Examples</h3> <pre> grid.newpage() grid.rect(width=.4, height=.4, x=.25, y=.75, gp=gpar(fill="black"), name="r1") grid.rect(width=.4, height=.4, x=.5, y=.5, gp=gpar(fill="grey"), name="r2") grid.rect(width=.4, height=.4, x=.75, y=.25, gp=gpar(fill="white"), name="r3") grid.DLapply(function(x) { if (is.grob(x)) x$gp <- gpar(); x }) grid.refresh() </pre> <hr /><div style="text-align: center;">[Package <em>grid</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>