Find Objects by (Partial) Name

apropos() returns a character vector giving the names of all objects in the search list matching what.

find() is a different user interface to the same task.

data, environment, documentation
apropos(what, where = FALSE, ignore.case = TRUE, mode = "any")

find(what, mode = "any", numeric = FALSE, simple.words = TRUE)

character string with name of an object, or more generally a regular expression to match against.
where, numeric
a logical indicating whether positions in the search list should also be returned
logical indicating if the search should be case-insensitive, TRUE by default. Note that in Rversions prior to 2.5.0, the default was implicitly ignore.case = FALSE.
character; if not "any", only objects whose mode equals mode are searched.
logical; if TRUE, the what argument is only searched as whole word.

If mode != "any" only those objects which are of mode mode are considered. If where is TRUE, the positions in the search list are returned as the names attribute.

find is a different user interface for the same task as apropos. However, by default (simple.words == TRUE), only full words are searched with grep(fixed = TRUE).


  • For apropos character vector, sorted by name, possibly with names giving the (numerical) positions on the search path.

    For find, either a character vector of environment names, or for numeric = TRUE, a numerical vector of positions on the search path, with names giving the names of the corresponding environments.

See Also

glob2rx to convert wildcard patterns to regular expressions.

objects for listing objects from one place, help.search for searching the help system, search for the search path.

  • apropos
  • find
library(utils) require(stats)apropos("lm") apropos("GLM") # more than a dozen ## that may include internal objects starting '.__C__' if ## methods is attached apropos("GLM", ignore.case = FALSE) # not one apropos("lq") cor <- 1:pi find("cor") #> ".GlobalEnv" "package:stats" find("cor", numeric = TRUE) # numbers with these names find("cor", numeric = TRUE, mode = "function") # only the second one rm(cor) apropos(".", mode="list") # a long list # need a DOUBLE backslash '\\\\' (in case you don't see it anymore) apropos("\\[") # everythinglength(apropos(".")) # those starting with 'pr' apropos("^pr") # the 1-letter things apropos("^.$") # the 1-2-letter things apropos("^..?$") # the 2-to-4 letter things apropos("^.{2,4}$") # the 8-and-more letter things apropos("^.{8,}$") table(nchar(apropos("^.{8,}$")))
Documentation reproduced from package utils, version 3.3, License: Part of R 3.3

Community examples

Looks like there are no examples yet.