View source: R/environment_of.R
environment_of | R Documentation |
Get the environment of an object
environment_of(envir)
envir |
An R object. |
Returns an environment
, if envir
is
an environment, a function, or a formula. In all other cases, NULL is
returned.
A non-empty character string.
## An environment
environment_of(globalenv()) ## <environment: R_GlobalEnv>
## A primitive function (always in the 'base' namespace)
environment_of(abs) ## <environment: namespace:base>
## A package function
environment_of(mean) ## <environment: namespace:base>
## Another package function
environment_of(stats::median) ## <environment: namespace:stats>
## A formula
environment_of(y ~ x) ## <environment: R_GlobalEnv>
## A non-function object
environment_of(pi) ## NULL
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.