Rev 73574 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{packageName}\alias{packageName}\title{Find Package Associated with an Environment}\description{Many environments are associated with a package; this functionattempts to determine that package.}\usage{packageName(env = parent.frame())}\arguments{\item{env}{The environment whose name we seek.}}\details{Environment \code{env} would be associated with a package if\code{\link{topenv}(env)} is the namespace environment for thatpackage. Thus when \code{env} is the environment associated withfunctions inside a package, or local functions defined within them,\code{packageName} will normally return the package name.Not all environments are associated with a package: for example,the global environment, or the evaluation frames of functions definedthere. \code{packageName} will return \code{NULL} in these cases.}\value{A length one character vector containing the name of the package,or \code{NULL} if there is no name.}\seealso{\code{\link[methods]{getPackageName}} is a more elaborate functionthat can construct a name if none is found.}\examples{packageName()packageName(environment(mean))}\keyword{ utilities }