help.search {base} | R Documentation |
Allows for searching the help system for documentation matching a given regular expression in the (file) name, alias, title, or keyword entries (or any combination thereof). Topics and titles of the matched help entries are nicely displayed.
help.search(pattern, fields = c("alias", "title"),
apropos, keyword, whatis, ignore.case = TRUE,
package = NULL, lib.loc = NULL,
help.db = getOption("help.db"),
verbose = getOption("verbose"),
rebuild = FALSE)
pattern |
a character string containing a regular expression to
be matched in the specified fields. If this is given, the arguments
|
fields |
a character vector specifying the fields of the help
data bases to be searched. The entries must be abbreviations of
|
apropos |
a character string containing a regular expression to be matched in the help page topics and title. |
keyword |
a character string containing a regular expression to be matched in the help page keywords. |
whatis |
a character string containing a regular expression to be matched in the help page topics. |
ignore.case |
a logical. If |
package |
a character vector with the names of packages to
search through, or |
lib.loc |
a character vector describing the location of R
library trees to search through, or |
help.db |
a character string giving the file path to a previously
built and saved help data base, or |
verbose |
logical; if |
rebuild |
a logical indicating whether the help data base should be rebuilt. |
Upon installation of a package, the Perl script ‘Rd2contents.pl’
creates a ‘CONTENTS’ data base which contains the information on
name, aliases, title and keywords (as well as the URL of the HTML
version of the help file) in Debian Control Format. This is the data
base searched by help.search()
.
The arguments apropos
and whatis
play a role similar to
the Unix commands with the same names.
If possible, the help data base is saved to the file ‘help.db’ in the ‘.R’ subdirectory of the user's home directory or the current working directory.
Note that currently, the aliases in the matching help files are not displayed.
The results are returned in an object of class "hsearch"
, which
has a print method for nicely displaying the results of the query.
This mechanism is experimental, and may change in future versions of
R.
help
;
help.start
for starting the hypertext (currently HTML)
version of R's online documentation, which offers a similar search
mechanism.
apropos
uses regexps and has nice examples.
help.search("linear models") # In case you forgot how to fit linear
# models
## Not run:
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.
## Help pages with documented topics starting with `try'.
help.search("\\btry", fields = "alias")
## Do not use `^' or `$' when matching aliases or keywords.
## End(Not run)