get_package_metadata: Get metadata associated with CRAN packages

Description Usage Arguments Value See Also Examples

Description

Retrieve metadata for one, several, or all packages from the crandb CRAN metadata service.

Usage

1
2
get_package_metadata(package_name = NULL, version = NULL,
  archived = is.null(package_name), verbose = NULL)

Arguments

package_name

character vector of package names or NULL, which requests download for all CRAN packages

version

either "all" or "latest", indicating whether to return metadata on all versions of a package or just the most recent; defaults to "latest" when user supplies non-NULL value for package_name; ignored if package_name = NULL because the API always returns metadata on all versions in that case

archived

logical indicator requesting or suppressing the inclusion of metadata for archived packages; only relevant when package_name = NULL, i.e. when retrieving metadata for all CRAN packages

verbose

Whether package names should be displayed as they are downloaded; ignored when downloading a single packages or all packages at once

Value

A named list containing the metadata associated with a single package or a named list with such a component for each requested package. This list contains the contents from the CRAN API, with one field added: retrieved, a POSIXct object with the time that the data was retrieved.

See Also

get_package_source and remove_package_source for the content of a package, and get_package_names to retrieve a listing of the names of packages on CRAN.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
## get all versions of all CRAN packages, even archived ones
everything <- get_package_metadata()
str(everything, max.level = 1, list.len = 5)

## filter out the archived packages
not_archived <- get_package_metadata(archived = FALSE)
str(not_archived, max.level = 1, list.len = 5)

## get metadata for latest version of a specific package
get_package_metadata("dplyr")

## get metadata for all versions of a specific package
get_package_metadata("dplyr", version = "all")

## get metadata for latest version of selected packages
just_a_few <- get_package_metadata(c("dplyr", "broom", "lattice", "car"))


## End(Not run)

Ironholds/practice documentation built on May 7, 2019, 6:41 a.m.