Learn R Programming

checkpoint (version 0.4.10)

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
# NOT RUN {
# 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
# }
# NOT RUN {
setSnapshot("2014-11-16")
# }
# NOT RUN {
# Invalid snapshot date (in future), returns error
# }
# NOT RUN {
setSnapshot("2100-01-01")
# }
# NOT RUN {
options(repos = oldRepos)
# }

Run the code above in your browser using DataLab