Vignette names, titles and keywords and demo names and titles may also be searched.
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
apropos
,
keyword
, and whatis
are ignored."name"
, "title"
, "alias"
, "concept"
, and
"keyword"
, 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.keyword
is specified, agrep
defaults to
FALSE
.TRUE
, case is ignored during
matching; if FALSE
, pattern matching is case sensitive.NULL
in which case all available
packages in the library trees specified by lib.loc
are
searched.NULL
. The default value
of NULL
corresponds to all libraries currently known.NULL
.TRUE
, the search process is traced.
Integer values are also accepted, with TRUE
being equivalent
to 2
, and 1
being less verbose. On Windows a progress
bar is shown during rebuilding, and on Unix a heartbeat is shown for
verbose = 1
and a package-by-package list for
verbose >= 2
.lib.loc
or
the search path is changed, or if package
is used and a value
is not found.NULL
(the default unless keyword
is
used) and the character string to
be matched consists of alphanumeric characters, whitespace or a dash
only, approximate (fuzzy) matching via agrep
is used
unless the string has fewer than 5 characters; otherwise, it is
taken to contain a regular expression to be matched via
grep
. If FALSE
, approximate matching is not
used. Otherwise, one can give a numeric or a list specifying the
maximal distance for the approximate match, see argument
max.distance
in the documentation for agrep
.agrep
to be Perl regexps."vignette"
"help"
or "demo"
. Results will be presented in the
order specified.fields
to search."hsearch"
,
which has a print method for nicely formatting the results of the
query. This mechanism is experimental, and may change in future
versions of R.In R.app
on OS X, 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.The internal format of the class is undocumented and subject to change.
hsearch_db
. The arguments apropos
and whatis
play a role similar to
the Unix commands with the same names.
Searching with agrep = FALSE
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).
If possible, the help database is saved in memory for use by subsequent calls in the session.
Note that currently the aliases in the matching help files are not displayed.
As with ?
, in ??
the pattern may be prefixed with a
package name followed by ::
or :::
to limit the search
to that package.
For help files, \keyword entries which are not among the standard keywords as listed in file KEYWORDS in the R documentation directory are taken as concepts. For standard keyword entries different from internal, the corresponding descriptions from file KEYWORDS are additionally taken as concepts. All \concept entries used as concepts.
Vignettes are searched as follows. The "name"
and
"alias"
are both the base of the vignette filename, and the
"concept"
entries are taken from the \VignetteKeyword
entries. Vignettes are not classified using the help system
"keyword"
classifications. Demos are handled
similarly to vignettes, without the "concept"
search.
hsearch_db
for more information on the help search
database employed, and for utilities to inspect available concepts and
keywords.
help
;
help.start
for starting the hypertext (currently HTML)
version of R's online documentation, which offers a similar search
mechanism. RSiteSearch
to access an on-line search of R resources.
apropos
uses regexps and has nice examples.
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")
Run the code above in your browser using DataLab