# pkg_env

0th

Percentile

##### Return package environment

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.

Keywords
internal
##### Usage
pkg_env(pkg = ".")
##### Arguments
pkg

package description, can be path or package name. See as.package for more information

##### 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.

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.