EVOLUTION-MANAGER
Edit File: grid.grep.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: Search for grobs</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.grep {grid}"><tr><td>grid.grep {grid}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Search for grobs </h2> <h3>Description</h3> <p>Given a gPath, find all matching grobs on the display list or within a given grob. </p> <h3>Usage</h3> <pre> grid.grep(path, x = NULL, grobs = TRUE, viewports = FALSE, strict = FALSE, grep = FALSE, global = FALSE, no.match = character()) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>path</code></td> <td> <p> a gPath. </p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p> a grob or <code>NULL</code>. If <code>NULL</code>, the display list is searched. </p> </td></tr> <tr valign="top"><td><code>grobs</code></td> <td> <p>A logical value indicating whether to search for grobs.</p> </td></tr> <tr valign="top"><td><code>viewports</code></td> <td> <p>A logical value indicating whether to search for viewports.</p> </td></tr> <tr valign="top"><td><code>strict</code></td> <td> <p>A boolean indicating whether the <code>path</code> must be matched exactly. </p> </td></tr> <tr valign="top"><td><code>grep</code></td> <td> <p>Whether the <code>path</code> should be treated as a regular expression. </p> </td></tr> <tr valign="top"><td><code>global</code></td> <td> <p>A boolean indicating whether the function should affect just the first match of the <code>path</code>, or whether all matches should be affected. </p> </td></tr> <tr valign="top"><td><code>no.match</code></td> <td> <p>The value to return if no matches are found. </p> </td></tr> </table> <h3>Value</h3> <p>Either a gPath or, if <code>global</code> is <code>TRUE</code> a list of gPaths. If there are no matches, <code>no.match</code> is returned. </p> <h3>See Also</h3> <p>grid.ls() </p> <h3>Examples</h3> <pre> # A gTree, called "grandparent", with child gTree, # called "parent", with childrenvp vpStack (vp2 within vp1) # and child grob, called "child", with vp vpPath (down to vp2) sampleGTree <- gTree(name="grandparent", children=gList(gTree(name="parent", children=gList(grob(name="child", vp="vp1::vp2")), childrenvp=vpStack(viewport(name="vp1"), viewport(name="vp2"))))) # Searching for grobs grid.grep("parent", sampleGTree) grid.grep("parent", sampleGTree, strict=TRUE) grid.grep("grandparent", sampleGTree, strict=TRUE) grid.grep("grandparent::parent", sampleGTree) grid.grep("parent::child", sampleGTree) grid.grep("[a-z]", sampleGTree, grep=TRUE) grid.grep("[a-z]", sampleGTree, grep=TRUE, global=TRUE) # Searching for viewports grid.grep("vp1", sampleGTree, viewports=TRUE) grid.grep("vp2", sampleGTree, viewports=TRUE) grid.grep("vp", sampleGTree, viewports=TRUE, grep=TRUE) grid.grep("vp2", sampleGTree, viewports=TRUE, strict=TRUE) grid.grep("vp1::vp2", sampleGTree, viewports=TRUE) # Searching for both grid.grep("[a-z]", sampleGTree, viewports=TRUE, grep=TRUE, global=TRUE) </pre> <hr /><div style="text-align: center;">[Package <em>grid</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>