packageDescription {base} | R Documentation |
Package Description
Description
Parses and returns the ‘DESCRIPTION’ file of a package.
Usage
packageDescription(pkg, lib.loc = NULL, fields = NULL, drop=TRUE)
Arguments
pkg |
a character string with the package name. |
lib.loc |
a character vector of directory names of R libraries,
or |
fields |
a character vector giving the tags of fields to return (if other fields occur in the file they are ignored). |
drop |
If |
Value
If a ‘DESCRIPTION’ for the given package is found and can
successfully be read, packageDescription
returns an object of
class "packageDescription"
, which is a named list
with the values of the (given) fields as elements and
the tags as names, unless drop = TRUE
.
If parsing the ‘DESCRIPTION’ file was not
successful, it returns a named list of NA
s
with the field tags as names if fields
is not null, and
NA
otherwise.
See Also
read.dcf
, package.contents
Examples
packageDescription("stats")
packageDescription("stats", fields = c("Package", "Version"))
packageDescription("stats", fields = "Version")
packageDescription("stats", fields = "Version", drop = FALSE)