Specifies a CRAN package to install in run environment

cran_package(name, version = NULL, repo = "https://cloud.r-project.org")

Arguments

name

The package name

version

A string of the package version. If not provided, version will default to latest

repo

The base URL of the repository to use, e.g., the URL of a CRAN mirror. If not provided, the package will be pulled from "https://cloud.r-project.org".

Value

A named list containing the package specifications

Examples

pkg1 <- cran_package("ggplot2", version = "3.3.0")
pkg2 <- cran_package("stringr")
pkg3 <- cran_package("ggplot2", version = "0.9.1",
                     repo = "http://cran.us.r-project.org")

env <- r_environment(name = "r_env",
                     cran_packages = list(pkg1, pkg2, pkg3))

See also

r_environment()