Learn R Programming

mvbutils (version 2.5.4)

search.for.regexpr: Find functions whose source contains a regexp. Can also search flatdoc-style function doco and character doc objects.

Description

Search one or more environments for objects that contain a regexp. Within each environment, check either (i) all functions, or (ii) the "doc" attributes of all functions, plus any character objects whose name ends in ".doc".

Usage

search.for.regexpr( pattern, where=1, lines=FALSE, doc=FALSE, ...)

Arguments

pattern
the regexp
where
an environment, something that can be coerced to an environment (so the default corresponds to .GlobalEnv), or a list of environments or things that can be coerced to environments.
lines
if FALSE, return names of objects mentioning the regexp. If TRUE, return the actual lines containing the regexp.
doc
if FALSE, search function source code. If TRUE, search the usual flatdoc places, i.e. "doc" attributes of functions, and character objects whose name ends in ".doc".
...
passed to grep-- e.g. "fixed", "ignore.case".

Value

  • A list with one element per environment searched, containing either a vector of object names that mention the regexp, or a named list of objects & the actual lines mentioning the regexp.

See Also

flatdoc, find.docholder, find.documented