ns-topenv

0th

Percentile

Top Level Environment

Finding the top level environment.

Keywords
programming
Usage
topenv(envir = parent.frame(), matchThisEnv = getOption("topLevelEnvironment"))
Arguments
envir
environment.
matchThisEnv
return this environment, if it matches before any other criterion is satisfied. The default, the option topLevelEnvironment, is set by sys.source, which treats a specific environment as the top level environment. Supplying the argument as NULL means it will never match.
Details

topenv returns the first top level environment found when searching envir and its enclosing environments. An environment is considered top level if it is the internal environment of a namespace, a package environment in the search path, or .GlobalEnv.

Aliases
  • topenv
Examples
library(base) topenv(.GlobalEnv) topenv(new.env())
Documentation reproduced from package base, version 3.1.3, License: Part of R 3.1.3

Community examples

Looks like there are no examples yet.