checkpoint (version 1.0.2)

use_mran_snapshot: Utilities for working with MRAN snapshots

Description

These functions are for working with the MRAN checkpoint server. use_mran_snapshot updates the CRAN mirror for your R session to point to an MRAN snapshot, using options(repos). list_mran_snapshots returns the dates for which an MRAN snapshot exists.

Usage

use_mran_snapshot(
  snapshot_date,
  mran_url = getOption("checkpoint.mranUrl", "https://mran.microsoft.com"),
  validate = FALSE
)

list_mran_snapshots( mran_url = getOption("checkpoint.mranUrl", "https://mran.microsoft.com") )

Arguments

snapshot_date

Date of snapshot to use in YYYY-MM-DD format, e.g. "2020-01-01". Specify a date on or after "2014-09-17".

mran_url

The base MRAN URL. The default is taken from the system option checkpoint.mranUrl, or if this is unset, https://mran.microsoft.com.

validate

For use_mran_snapshot, whether to check if the snapshot date is valid (exists on the server).

Value

For use_mran_snapshot, the new value of getOption("repos"), invisibly. For list_mran_snapshots, a character vector of snapshot dates.

Examples

Run this code
# NOT RUN {
list_mran_snapshots()

use_mran_snapshot("2020-01-01")

# validate=TRUE will detect an invalid snapshot date
use_mran_snapshot("1970-01-01", validate=TRUE)

# }

Run the code above in your browser using DataCamp Workspace