Rev 28867 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{packageDescription}\alias{packageDescription}\alias{print.packageDescription}\title{Package Description}\description{Parses and returns the \file{DESCRIPTION} file of a package.}\usage{packageDescription(pkg, lib.loc = NULL, fields = NULL, drop=TRUE)}\arguments{\item{pkg}{a character string with the package name.}\item{lib.loc}{a character vector of directory names of \R libraries,or \code{NULL}. The default value of \code{NULL} corresponds to alllibraries currently known. If the default is used, the loadedpackages are searched before the libraries.}\item{fields}{a character vector giving the tags of fields to return(if other fields occur in the file they are ignored).}\item{drop}{If \code{TRUE} and the length of \code{fields} is 1, thena single character string with the value of the respective field isreturned instead of an object of class \code{"packageDescription"}.}}\value{If a \file{DESCRIPTION} for the given package is found and cansuccessfully be read, \code{packageDescription} returns an object ofclass \code{"packageDescription"}, which is a named listwith the values of the (given) fields as elements andthe tags as names, unless \code{drop = TRUE}.If parsing the \file{DESCRIPTION} file was notsuccessful, it returns a named list of \code{NA}swith the field tags as names if \code{fields} is not null, and\code{NA} otherwise.}\seealso{\code{\link{read.dcf}}, \code{\link[utils]{package.contents}}}\examples{packageDescription("stats")packageDescription("stats", fields = c("Package", "Version"))packageDescription("stats", fields = "Version")packageDescription("stats", fields = "Version", drop = FALSE)}\keyword{utilities}