get {base} | R Documentation |
Search for an R object with a given name and return it if found.
get(x, pos=-1, envir=pos.to.env(pos), mode="any", inherits=TRUE)
x |
a variable name (given as a quoted character string). |
pos |
position in search list, can be numerical or a quoted string. |
envir |
the environment to be used. |
mode |
the mode of object sought. |
inherits |
should the enclosing frames of the environment be inspected? |
The mode
includes collections such as "numeric"
and
"function"
: any member of the collection will suffice.
This function searches the specified environment for a bound variable
whose name is given by the character string x
. If the
variable's value is not of the correct mode
, it is ignored.
If inherits
is FALSE
, only the first frame of the
specified environment is inspected. If inherits
is
TRUE
, the search is continued up through the parent frames
until a bound value of the right mode is found.
Using a NULL
environment is equivalent to using the current
environment.
get("%o%")