help.search {utils} | R Documentation |
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 fuzzy matching or regular expression matching. Names and titles of the matched help entries are displayed nicely formatted.
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)
??pattern
field??pattern
pattern |
a character string 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 to be matched in the help page topics and title. |
keyword |
a character string to be matched in the help page
‘keywords’. ‘Keywords’ are really categories: the
standard categories are listed in file ‘RHOME/doc/KEYWORDS’
(see also the example) and some package writers have defined their
own. If |
whatis |
a character string 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. This will be done automatically if |
agrep |
if |
field |
a single value of |
Upon installation of a package, a pre-built help.search index is serialized as ‘hsearch.rds’ in the ‘Meta’ directory (provided the package has any help pages). These files are used to create the data base.
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.
If possible, the help data base is saved in memory or (if memory
limits have been set: see mem.limits
) to a file in the
session temporary directory for use by subsequent calls in the
session.
Note that currently the aliases in the matching help files are not displayed.
Matching by agrep
is by bytes even in multi-byte locales:
character-by-character matching will be too slow with a thousand or
more packages.
As with ?
, in ??
the pattern may be prefixed with a
package name followed by ::
or :::
to limit the search
to that package.
The results are returned in a list object of class "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 Mac 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.
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
## 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.
file.show(file.path(R.home("doc"), "KEYWORDS")) # show all keywords
## Help pages with documented topics starting with 'try'.
help.search("\\btry", fields = "alias")
## End(Not run)