EVOLUTION-MANAGER
Edit File: apropos.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: Find Objects by (Partial) Name</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 apropos {utils}"><tr><td>apropos {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Find Objects by (Partial) Name</h2> <h3>Description</h3> <p><code>apropos()</code> returns a character vector giving the names of objects in the search list matching (as a regular expression) <code>what</code>. </p> <p><code>find()</code> returns where objects of a given name can be found. </p> <h3>Usage</h3> <pre> apropos(what, where = FALSE, ignore.case = TRUE, mode = "any") find(what, mode = "any", numeric = FALSE, simple.words = TRUE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>what</code></td> <td> <p>character string. For <code>simple.words = FALSE</code> the name of an object; otherwise a <a href="../../base/html/regex.html">regular expression</a> to match object names against.</p> </td></tr> <tr valign="top"><td><code>where, numeric</code></td> <td> <p>a logical indicating whether positions in the search list should also be returned</p> </td></tr> <tr valign="top"><td><code>ignore.case</code></td> <td> <p>logical indicating if the search should be case-insensitive, <code>TRUE</code> by default.</p> </td></tr> <tr valign="top"><td><code>mode</code></td> <td> <p>character; if not <code>"any"</code>, only objects whose <code><a href="../../base/html/mode.html">mode</a></code> equals <code>mode</code> are searched.</p> </td></tr> <tr valign="top"><td><code>simple.words</code></td> <td> <p>logical; if <code>TRUE</code>, the <code>what</code> argument is only searched as a whole word.</p> </td></tr> </table> <h3>Details</h3> <p>If <code>mode != "any"</code> only those objects which are of mode <code>mode</code> are considered. </p> <p><code>find</code> is a different user interface for a similar task to <code>apropos</code>. By default (<code>simple.words == TRUE</code>), only whole names are matched. Unlike <code>apropos</code>, matching is always case-sensitive. </p> <p>Unlike the default behaviour of <code><a href="../../base/html/ls.html">ls</a></code>, names which begin with a <span class="samp">.</span> are included (and these are often ‘internal’ objects — as from <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> 3.4.0 most such are excluded). </p> <h3>Value</h3> <p>For <code>apropos</code>, a character vector sorted by name. For <code>where = TRUE</code> this has names giving the (numerical) positions on the search path. </p> <p>For <code>find</code>, either a character vector of environment names or (for <code>numeric = TRUE</code>) a numerical vector of positions on the search path with names the names of the corresponding environments. </p> <h3>Author(s)</h3> <p>Originally, Kurt Hornik and Martin Maechler (May 1997).</p> <h3>See Also</h3> <p><code><a href="glob2rx.html">glob2rx</a></code> to convert wildcard patterns to regular expressions. </p> <p><code><a href="../../base/html/ls.html">objects</a></code> for listing objects from one place, <code><a href="help.search.html">help.search</a></code> for searching the help system, <code><a href="../../base/html/search.html">search</a></code> for the search path. </p> <h3>Examples</h3> <pre> require(stats) ## Not run: apropos("lm") apropos("GLM") # several apropos("GLM", ignore.case = FALSE) # not one apropos("lq") cor <- 1:pi find("cor") #> ".GlobalEnv" "package:stats" find("cor", numeric = TRUE) # numbers with these names find("cor", numeric = TRUE, mode = "function") # only the second one rm(cor) ## Not run: apropos(".", mode="list") # a long list # need a DOUBLE backslash '\\' (in case you don't see it anymore) apropos("\\[") # everything % not diff-able length(apropos(".")) # those starting with 'pr' apropos("^pr") # the 1-letter things apropos("^.$") # the 1-2-letter things apropos("^..?$") # the 2-to-4 letter things apropos("^.{2,4}$") # the 8-and-more letter things apropos("^.{8,}$") table(nchar(apropos("^.{8,}$"))) </pre> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>