package.description {base}R Documentation

Package Description

Description

Parses and returns the ‘DESCRIPTION’ file of a package.

Usage

package.description(pkg, lib.loc = NULL, fields = NULL)

Arguments

pkg a character string with the package name.
lib.loc a character vector of directory names of R libraries, or NULL. The default value of NULL corresponds to all libraries currently known. If the default is used, the loaded packages are searched before the libraries.
fields a character vector giving the tags of fields to return (if other fields occur in the file they are ignored).

Value

If a ‘DESCRIPTION’ for the given package is found and can successfully be read, package.description returns a named character vector with the values of the (given) fields as elements and the tags as names. If not, it returns a named vector of NAs with the field tags as names if fields is not null, and NA otherwise.

See Also

read.dcf, package.contents

Examples

package.description("ts")
package.description("ts")[c("Package", "Version")]
## NOTE: No subscripting using '$' or abbreviated field tags!

[Package Contents]