print.hsearch {tutoR} | 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.
print.hsearch(x, ...)
x |
When a help file is not found by eg(func) ,
then func is taken a character string (pattern) to be
matched using help.search .
print.hsearch is called by help.search , also appropriately
updated to give reference back to using eg . |
... |
Fields passed from help.search as required. |
,
Upon installation of a package, a contents data base which contains
the information on name, title, aliases and keywords and, concepts
starting with R 1.8.0, is computed from the Rd files in the package and
serialized as ‘Rd.rds’ in the ‘Meta’ subdirectory of the
top-level package installation directory (or, prior to R 1.7.0, as
‘CONTENTS’ in Debian Control Format with aliases and keywords
collapsed to character strings in the top-level package installation
directory). This, or a pre-built help.search index serialized as
‘hsearch.rds’ in the ‘Meta’ directory, is the data base
searched by help.search()
.
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
;
eg
;
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.
eg("linear models") # In case you forgot how to fit linear # models eg("non-existent topic") ## Not run: eg("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") ## Do not use '^' or '$' when matching aliases or keywords ## (unless all packages were installed using R 1.7 or newer). ## End(Not run)