Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pkg_env

Return package environment


Description

This is an environment like <package:pkg>. The package environment contains the exported objects from a package. It is attached, so it is an ancestor of R_GlobalEnv.

Usage

pkg_env(package)

Arguments

package

package name.

Details

When a package is loaded the normal way, using library(), this environment contains only the exported objects from the namespace. However, when loaded with load_all(), this environment will contain all the objects from the namespace, unless load_all is used with export_all=FALSE.

If the package is not attached, this function returns NULL.

See Also

ns_env() for the namespace environment that all the objects (exported and not exported).

imports_env() for the environment that contains imported objects for the package.


pkgload

Simulate Package Installation and Attach

v1.2.1
GPL-3
Authors
Hadley Wickham [aut], Jim Hester [aut, cre], Winston Chang [aut], RStudio [cph], R Core team [ctb] (Some namespace and vignette code extracted from base R)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.