mran: Utilities for working with MRAN snapshots

Description Usage Arguments Value Examples

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

1
2
3
4
5
6
7
8
9
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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)


## End(Not run)

checkpoint documentation built on Jan. 29, 2022, 1:07 a.m.