Learn R Programming

box (version 1.2.0)

topenv: Get a module’s namespace environment

Description

Called inside a module, box::topenv() returns the module namespace environment. Otherwise, it behaves similarly to topenv.

Usage

box::topenv()

box::topenv(env)

Value

box::topenv() returns the top-level module environment of the module it is called from, or the nearest top-level non-module environment otherwise; this is usually .GlobalEnv.

box::topenv(env) returns the nearest top-level environment that is a direct or indirect parent of env.

Arguments

module

a module environment