R: Set default CRAN repository to MRAN snapshot date.

setSnapshot {checkpoint} | R Documentation

## 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

    # 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")

    ## End(Not run)

    # Invalid snapshot date (in future), returns error
    ## Not run:
    setSnapshot("2100-01-01")

    ## End(Not run)

    options(repos = oldRepos)

[Package checkpoint version 0.4.1 Index]