EVOLUTION-MANAGER
Edit File: help.search.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 the Help System</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 help.search {utils}"><tr><td>help.search {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Search the Help System</h2> <h3>Description</h3> <p>Allows for searching the help system for documentation matching a given character string in the (file) name, alias, title, concept or keyword entries (or any combination thereof), using either <a href="../../base/html/agrep.html">fuzzy matching</a> or <a href="../../base/html/regex.html">regular expression</a> matching. Names and titles of the matched help entries are displayed nicely formatted. </p> <p>Vignette names, titles and keywords and demo names and titles may also be searched. </p> <h3>Usage</h3> <pre> help.search(pattern, fields = c("alias", "concept", "title"), apropos, keyword, whatis, ignore.case = TRUE, package = NULL, lib.loc = NULL, help.db = getOption("help.db"), verbose = getOption("verbose"), rebuild = FALSE, agrep = NULL, use_UTF8 = FALSE, types = getOption("help.search.types")) ??pattern field??pattern </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>pattern</code></td> <td> <p>a character string to be matched in the specified fields. If this is given, the arguments <code>apropos</code>, <code>keyword</code>, and <code>whatis</code> are ignored.</p> </td></tr> <tr valign="top"><td><code>fields</code></td> <td> <p>a character vector specifying the fields of the help database to be searched. The entries must be abbreviations of <code>"name"</code>, <code>"title"</code>, <code>"alias"</code>, <code>"concept"</code>, and <code>"keyword"</code>, corresponding to the help page's (file) name, its title, the topics and concepts it provides documentation for, and the keywords it can be classified to. See below for details and how vignettes and demos are searched.</p> </td></tr> <tr valign="top"><td><code>apropos</code></td> <td> <p>a character string to be matched in the help page topics and title.</p> </td></tr> <tr valign="top"><td><code>keyword</code></td> <td> <p>a character string to be matched in the help page ‘keywords’. ‘Keywords’ are really categories: the standard categories are listed in file ‘<span class="file">R.home("doc")/KEYWORDS</span>’ (see also the example) and some package writers have defined their own. If <code>keyword</code> is specified, <code>agrep</code> defaults to <code>FALSE</code>.</p> </td></tr> <tr valign="top"><td><code>whatis</code></td> <td> <p>a character string to be matched in the help page topics.</p> </td></tr> <tr valign="top"><td><code>ignore.case</code></td> <td> <p>a logical. If <code>TRUE</code>, case is ignored during matching; if <code>FALSE</code>, pattern matching is case sensitive.</p> </td></tr> <tr valign="top"><td><code>package</code></td> <td> <p>a character vector with the names of packages to search through, or <code>NULL</code> in which case <em>all</em> available packages in the library trees specified by <code>lib.loc</code> are searched.</p> </td></tr> <tr valign="top"><td><code>lib.loc</code></td> <td> <p>a character vector describing the location of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> library trees to search through, or <code>NULL</code>. The default value of <code>NULL</code> corresponds to all libraries currently known.</p> </td></tr> <tr valign="top"><td><code>help.db</code></td> <td> <p>a character string giving the file path to a previously built and saved help database, or <code>NULL</code>.</p> </td></tr> <tr valign="top"><td><code>verbose</code></td> <td> <p>logical; if <code>TRUE</code>, the search process is traced. Integer values are also accepted, with <code>TRUE</code> being equivalent to <code>2</code>, and <code>1</code> being less verbose. On Windows a progress bar is shown during rebuilding, and on Unix a heartbeat is shown for <code>verbose = 1</code> and a package-by-package list for <code>verbose >= 2</code>.</p> </td></tr> <tr valign="top"><td><code>rebuild</code></td> <td> <p>a logical indicating whether the help database should be rebuilt. This will be done automatically if <code>lib.loc</code> or the search path is changed, or if <code>package</code> is used and a value is not found.</p> </td></tr> <tr valign="top"><td><code>agrep</code></td> <td> <p>if <code>NULL</code> (the default unless <code>keyword</code> is used) and the character string to be matched consists of alphanumeric characters, whitespace or a dash only, approximate (fuzzy) matching via <code><a href="../../base/html/agrep.html">agrep</a></code> is used unless the string has fewer than 5 characters; otherwise, it is taken to contain a <a href="../../base/html/regex.html">regular expression</a> to be matched via <code><a href="../../base/html/grep.html">grep</a></code>. If <code>FALSE</code>, approximate matching is not used. Otherwise, one can give a numeric or a list specifying the maximal distance for the approximate match, see argument <code>max.distance</code> in the documentation for <code><a href="../../base/html/agrep.html">agrep</a></code>.</p> </td></tr> <tr valign="top"><td><code>use_UTF8</code></td> <td> <p>logical: should results be given in UTF-8 encoding? Also changes the meaning of regexps in <code>agrep</code> to be Perl regexps.</p> </td></tr> <tr valign="top"><td><code>types</code></td> <td> <p>a character vector listing the types of documentation to search. The entries must be abbreviations of <code>"vignette"</code> <code>"help"</code> or <code>"demo"</code>. Results will be presented in the order specified.</p> </td></tr> <tr valign="top"><td><code>field</code></td> <td> <p>a single value of <code>fields</code> to search.</p> </td></tr> </table> <h3>Details</h3> <p>Upon installation of a package, a pre-built help.search index is serialized as ‘<span class="file">hsearch.rds</span>’ in the ‘<span class="file">Meta</span>’ directory (provided the package has any help pages). Vignettes are also indexed in the ‘<span class="file">Meta/vignette.rds</span>’ file. These files are used to create the help search database via <code><a href="hsearch-utils.html">hsearch_db</a></code>. </p> <p>The arguments <code>apropos</code> and <code>whatis</code> play a role similar to the Unix commands with the same names. </p> <p>Searching with <code>agrep = FALSE</code> will be several times faster than the default (once the database is built). However, approximate searches should be fast enough (around a second with 5000 packages installed). </p> <p>If possible, the help database is saved in memory for use by subsequent calls in the session. </p> <p>Note that currently the aliases in the matching help files are not displayed. </p> <p>As with <code><a href="Question.html">?</a></code>, in <code>??</code> the pattern may be prefixed with a package name followed by <code>::</code> or <code>:::</code> to limit the search to that package. </p> <p>For help files, <span class="samp">\keyword</span> entries which are not among the standard keywords as listed in file ‘<span class="file">KEYWORDS</span>’ in the <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> documentation directory are taken as concepts. For standard keyword entries different from <span class="samp">internal</span>, the corresponding descriptions from file ‘<span class="file">KEYWORDS</span>’ are additionally taken as concepts. All <span class="samp">\concept</span> entries used as concepts. </p> <p>Vignettes are searched as follows. The <code>"name"</code> and <code>"alias"</code> are both the base of the vignette filename, and the <code>"concept"</code> entries are taken from the <code>\VignetteKeyword</code> entries. Vignettes are not classified using the help system <code>"keyword"</code> classifications. Demos are handled similarly to vignettes, without the <code>"concept"</code> search. </p> <h3>Value</h3> <p>The results are returned in a list object of class <code>"hsearch"</code>, which has a print method for nicely formatting the results of the query. This mechanism is experimental, and may change in future versions of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>. </p> <p>In <code>R.app</code> on macOS, this will show up a browser with selectable items. On exiting this browser, the help pages for the selected items will be shown in separate help windows. </p> <p>The internal format of the class is undocumented and subject to change. </p> <h3>See Also</h3> <p><code><a href="hsearch-utils.html">hsearch_db</a></code> for more information on the help search database employed, and for utilities to inspect available concepts and keywords. </p> <p><code><a href="help.html">help</a></code>; <code><a href="help.start.html">help.start</a></code> for starting the hypertext (currently HTML) version of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>'s online documentation, which offers a similar search mechanism. </p> <p><code><a href="RSiteSearch.html">RSiteSearch</a></code> to access an on-line search of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> resources. </p> <p><code><a href="apropos.html">apropos</a></code> uses regexps and has nice examples. </p> <h3>Examples</h3> <pre> help.search("linear models") # In case you forgot how to fit linear # models help.search("non-existent topic") ??utils::help # All the topics matching "help" in the utils package help.search("print") # All help pages with topics or title # matching 'print' help.search(apropos = "print") # The same help.search(keyword = "hplot") # All help pages documenting high-level # plots. file.show(file.path(R.home("doc"), "KEYWORDS")) # show all keywords ## Help pages with documented topics starting with 'try'. help.search("\\btry", fields = "alias") </pre> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>