apropos                package:utils                R Documentation

_F_i_n_d _O_b_j_e_c_t_s _b_y (_P_a_r_t_i_a_l) _N_a_m_e

_D_e_s_c_r_i_p_t_i_o_n:

     '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 as
     'apropos'.

_U_s_a_g_e:

     apropos(what, where = FALSE, mode = "any")

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

_A_r_g_u_m_e_n_t_s:

    what: name of an object, or regular expression to match against

where, numeric.: a logical indicating whether positions in the search
          list should also be returned

    mode: character; if not '"any"', only objects who's 'mode' equals
          'mode' are searched.

simple.words: logical; if 'TRUE', the 'what' argument is only searched
          as whole word.

_D_e_t_a_i_l_s:

     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)'.

_A_u_t_h_o_r(_s):

     Kurt Hornik and Martin Maechler (May 1997).

_S_e_e _A_l_s_o:

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

_E_x_a_m_p_l_e_s:

     ## Not run: apropos("lm")
     apropos(ls)
     apropos("lq")

     cor <- 1:pi
     find(cor)        #> ".GlobalEnv"   "package:stats"
     find(cor, num=TRUE) # numbers with these names
     find(cor, num=TRUE, mode="function")# only the second one
     rm(cor)

     ## Not run: apropos(".", mode="list") # a long list

     # need a DOUBLE backslash '\\' (in case you don't see it anymore)
     apropos("\\[")

     ## Not run: # everything 
     length(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,}$")))
     ## End(Not run)

