| CRANtools {tools} | R Documentation |
CRAN Package Repository Tools
Description
Tools for obtaining information about current packages in the CRAN package repository, and their check status.
Usage
CRAN_package_db()
CRAN_check_results(flavors = NULL)
CRAN_check_details(flavors = NULL)
CRAN_check_issues()
summarize_CRAN_check_status(packages,
results = NULL,
details = NULL,
issues = NULL)
Arguments
packages |
a character vector of package names. |
flavors |
a character vector of CRAN check flavor names, or
|
results |
the return value of |
details |
the return value of |
issues |
the return value of |
Details
CRAN_package_db() returns a data frame with character columns
containing most ‘DESCRIPTION’ metadata for the current packages
in the CRAN package repository, including in particular the
Description and Maintainer information not provided by
utils::available.packages().
CRAN_check_results() returns a data frame with the basic
CRAN package check results including timings, with columns
Package, Flavor and Status giving the package
name, check flavor, and overall check status, respectively.
CRAN_check_details() returns a data frame inheriting from class
"check_details" (which has useful print and
format methods) with details on the check results, providing
check name, status and output for every non-OK check (via
columns Check, Status and Output, respectively).
Packages with all-OK checks are indicated via a * Check
wildcard name and OK Status.
CRAN_check_issues() returns a character frame with additional
check issues (including the memory-access check results made available
from https://www.stats.ox.ac.uk/pub/bdr/memtests/) as a
character frame with variables Package, Version,
kind (an identifier for the issue) and href (a URL with
information on the issue).
Value
See ‘Details’. Note that the results are collated on
CRAN: currently this is done in a locale which sorts
aAbB ....
Which CRAN?
The main functions access a CRAN mirror specified by the
environment variable R_CRAN_WEB, defaulting to one specified in
the "repos" option. Otherwise the entry in the
‘repositories’ file (see setRepositories) is used:
if that specifies ‘@CRAN@’ (the default) or does not contain an
entry for CRAN then https://CRAN.R-project.org is used.
The mirror to be used is reported by
utils::findCRANmirror("web").
Note that these functions access parts of CRAN under ‘web/contrib’ and ‘web/packages’ so if you have specified a mirror of just ‘src/contrib’ for installing packages you will need to set R_CRAN_WEB to point to a full mirror.
Internal functions CRAN_aliases_db, CRAN_archive_db,
CRAN_current_db and CRAN_rdxrefs_db (used by R
CMD check) use R_CRAN_SRC rather than R_CRAN_WEB.
Examples
## This can be rather slow with a non-local CRAN mirror
## and might fail (slowly) without Internet access in that case.
set.seed(11) # but the packages chosen will change as soon as CRAN does.
pdb <- CRAN_package_db()
dim(pdb)
## DESCRIPTION fields included:
colnames(pdb)
## Summarize publication dates:
summary(as.Date(pdb$Published))
## Summarize numbers of packages according to maintainer:
summary(lengths(split(pdb$Package, pdb$Maintainer)))
## Packages with 'LASSO' in their Description:
pdb$Package[grepl("LASSO", pdb$Description)]
results <- CRAN_check_results()
## Available variables:
names(results)
## Tabulate overall check status according to flavor:
with(results, table(Flavor, Status))
details <- CRAN_check_details()
## Available variables:
names(details)
## Tabulate checks according to their status:
tab <- with(details, table(Check, Status))
## Inspect some installation problems:
bad <- subset(details,
((Check == "whether package can be installed") &
(Status != "OK")))
## Show a random sample of up to 6
head(bad[sample(seq_len(NROW(bad)), NROW(bad)), ])
issues <- CRAN_check_issues()
head(issues)
## Show counts of issues according to kind:
table(issues[, "kind"])
## Summarize CRAN check status for 10 randomly-selected packages
## (reusing the information already read in):
pos <- sample(seq_len(NROW(pdb)), 10L)
summarize_CRAN_check_status(pdb[pos, "Package"],
results, details, issues)