The pkg_repo function combines information related to a package repository. The function retrieves all the packages in a repository for a specified version of R. Results will list the package name and version.

pkg_repo(pkgs = NULL, ver = "current", libpaths = NULL)

Arguments

pkgs

A vector of package names used to subset the repository list. Default is NULL, which means all packages in the repository will be returned.

ver

The R version of the repository. Pass the R version as a quoted string. Default is "current", meaning the current version of the repository. The value "latest" will return the latest versions on CRAN.

libpaths

A vector of paths specifying the locations of the repositories to query. Default is NULL, meaning the function will use the default R locations on the machine. These default paths are identified by the Base R function .libPaths().

Value

An object of class "prepo". The object will contain a data frame of R packages with corresponding version numbers. This table may then be passed to repo_breakages or repo_stability.

If a package is not found in the repo, a row will still be returned for the package. However, the version will appear as NA.

Examples

# Create vector of packages
pkgs <- c("common", "dplyr", "rvest", "stringr")

# Retrieve latest versions
pkg_repo(pkgs, ver = "latest")
# # A package repo object
# - Repo Version: latest
# - Packages:
#   Package Version
# 1  common   1.1.3
# 2   dplyr   1.1.4
# 3   rvest   1.0.4
# 4 stringr   1.5.1