version_cran: Get CRAN version

Description Usage Arguments Value Examples

View source: R/rprofile.R

Description

This function assigns a date to each version of R, which can be used to set a versioned CRAN package repository.

Usage

1
2
3
4
map_r_to_snapshot(...)

version_cran(..., r_name = getOption("rprofile.r_name",
  version_r_major_minor()), latest = getOption("rprofile.latest", FALSE))

Arguments

...

Custom mappings in name (R version) value (snapshot) pairs. Overrides default values returned by rprofile::map_r_to_snapshot().

r_name

An R version (e.g. "3.5") used to select the snapshot. Defaults to "rprofile.r_name" option if set, else rprofile::version_r_major_minor().

latest

Logical. Use the CRAN mirror without a snapshot date. Defaults to "rprofile.latest" option if set, else FALSE.

Value

Returns a date in "YYYY-MM-DD" format, or "latest". For unkown R versions, the release date for the current R session version will be used as a fall back unless latest = TRUE.

Examples

1
2
3
4
5
# Get default snapshot date for current R version
rprofile::version_cran()

# Change the snapshot date for version 3.3
rprofile::version_cran("3.3" = "2100-05-01")

EricEdwardBryant/rprofile documentation built on Dec. 7, 2019, 12:30 a.m.