# NOT RUN {
# List the names of scoped environments:
nms <- scoped_names()
nms
# The global environment is always the first in the chain:
scoped_env(nms[[1]])
# And the scoped environment of the base package is always the last:
scoped_env(nms[[length(nms)]])
# These two environments have their own shortcuts:
global_env()
base_env()
# Packages appear in the search path with a special name. Use
# pkg_env_name() to create that name:
pkg_env_name("rlang")
scoped_env(pkg_env_name("rlang"))
# Alternatively, get the scoped environment of a package with
# pkg_env():
pkg_env("utils")
# }
Run the code above in your browser using DataLab