% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/env-special.R
\name{ns_env}
\alias{ns_env}
\alias{ns_imports_env}
\alias{ns_env_name}
\title{Get the namespace of a package}
\usage{
ns_env(x = caller_env())

ns_imports_env(x = caller_env())

ns_env_name(x = caller_env())
}
\arguments{
\item{x}{\itemize{
\item For \code{ns_env()}, the name of a package or an environment as a
string.
\itemize{
\item An environment (the current environment by default).
\item A function.
}

In the latter two cases, the environment ancestry is searched for
a namespace with \code{\link[base:ns-topenv]{base::topenv()}}. If the environment doesn't
inherit from a namespace, this is an error.
}}
}
\description{
Namespaces are the environment where all the functions of a package
live. The parent environments of namespaces are the \code{imports}
environments, which contain all the functions imported from other
packages.
}
\seealso{
\code{\link[=pkg_env]{pkg_env()}}
}
\keyword{internal}
