Rev 42333 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/utils/man/apropos.Rd% Part of the R package, http://www.R-project.org% Copyright 1995-2007 R Core Development Team% Distributed under GPL 2 or later\name{apropos}\title{Find Objects by (Partial) Name}\usage{apropos(what, where = FALSE, ignore.case = TRUE, mode = "any")find(what, mode = "any", numeric = FALSE, simple.words = TRUE)}\alias{apropos}\alias{find}\arguments{\item{what}{character string with name of an object, or more generallya \link{regular expression} to match against.}\item{where, numeric}{a logical indicating whether positions in thesearch list should also be returned}\item{ignore.case}{logical indicating if the search should becase-insensitive, \code{TRUE} by default. Note that in \R versionsprior to 2.5.0, the default was implicitly \code{ignore.case = FALSE}.}\item{mode}{character; if not \code{"any"}, only objects whose\code{\link{mode}} equals \code{mode} are searched.}\item{simple.words}{logical; if \code{TRUE}, the \code{what} argument isonly searched as whole word.}}\description{\code{apropos()} returns a character vector giving the names ofall objects in the search list matching \code{what}.\code{find()} is a different user interface to the same task.}\details{If \code{mode != "any"} only those objects which are of mode \code{mode}are considered.If \code{where} is \code{TRUE}, the positions in the search list arereturned as the names attribute.\code{find} is a different user interface for the same task as\code{apropos}. However, by default (\code{simple.words == TRUE}),only full words are searched with \code{grep(fixed = TRUE)}.Note that in \R versions prior to 2.5.0, \code{what} was allowed to benon-character, such that \code{find(cor)} worked as it does in S.This possibility has been dropped in line with the aim of minimizingall use of non-standard evaluation in \R.}\author{Kurt Hornik and Martin Maechler (May 1997).}\value{For \code{apropos} character vector, sorted by name, possibly withnames giving the (numerical) positions on the search path.For \code{find}, either a character vector of environment names, or for\code{numeric = TRUE}, a numerical vector of positions on the search path,with names giving the names of the corresponding environments.}\seealso{\code{\link{glob2rx}} to convert wildcard patterns to regular expressions.\code{\link{objects}} for listing objects from one place,\code{\link{help.search}} for searching the help system,\code{\link{search}} for the search path.}\examples{require(stats)%% some of these have enormous output that varies a lot by version\dontrun{apropos("lm")}apropos("GLM") # more than a dozen## that may include internal objects starting '.__C__' if## methods is attachedapropos("GLM", ignore.case = FALSE) # not oneapropos("lq")cor <- 1:pifind("cor") #> ".GlobalEnv" "package:stats"find("cor", numeric=TRUE) # numbers with these namesfind("cor", numeric=TRUE, mode="function")# only the second onerm(cor)\dontrun{apropos(".", mode="list") # a long list}# need a DOUBLE backslash '\\\\' (in case you don't see it anymore)apropos("\\\\[")\dontrun{# everything % not diff-ablelength(apropos("."))# those starting with 'pr'apropos("^pr")# the 1-letter thingsapropos("^.$")# the 1-2-letter thingsapropos("^..?$")# the 2-to-4 letter thingsapropos("^.{2,4}$")# the 8-and-more letter thingsapropos("^.{8,}$")table(nchar(apropos("^.{8,}$")))}}\keyword{data}\keyword{documentation}\keyword{environment}