checkpoint (version 0.4.0)

setSnapshot: Set default CRAN repository to MRAN snapshot date.

Description

Set default CRAN repository to MRAN snapshot date.

Usage

setSnapshot(snapshotDate, online = TRUE)

Arguments

snapshotDate

Date of snapshot to use in YYYY-MM-DD format, e.g. "2014-09-17". Specify a date on or after "2014-09-17". MRAN takes one snapshot per day. To list all valid snapshot dates on MRAN use getValidSnapshots()

online

If TRUE, performs online validation checks. This can be set to FALSE for programming purposes. Internally, checkpoint() sets this value to FALSE when not scanning for packages.

See Also

Other checkpoint functions: checkpointArchives, checkpointRemove, checkpoint, getAccessDate, getValidSnapshots, mranUrl, unCheckpoint

Examples

Run this code
# Empty date field returns current repo

oldRepos <- getOption("repos")
setSnapshot()

# Valid snapshot date
# Connects to MRAN to check for valid URL, so skip on CRAN

setSnapshot("2014-11-16")


# Invalid snapshot date (in future), returns error

setSnapshot("2100-01-01")


options(repos = oldRepos)

Run the code above in your browser using DataCamp Workspace