Learn R Programming

versions (version 0.3)

install.dates: install.dates

Description

Download and install the latest versions of packages hosted on CRAN as of a specific date from the MRAN server.

Usage

install.dates(pkgs, dates, lib, ...)

Arguments

pkgs
character vector of the names of packages that should be downloaded and installed
dates
character or Date vector of the dates for which to install the latest versions of pkgs. If a data vector, it must be in the format 'yyyy-mm-dd', e.g. '2014-09-17'. If this has the same length as pkgs versions will correspond to those packages. If this has length one the same version will be used for all packages. If it has any other length an error will be thrown. Dates before 2014-09-17 will cause an error as MRAN does not archive before that date.
lib
character vector giving the library directories where to install the packages. Recycled as needed. If missing, defaults to the first element of .libPaths().
...
other arguments to be passed to install.packages. The arguments repos and contriburl (at least) will be ignored as the function uses the MRAN server to retrieve package versions.

Examples

Run this code

## Not run: 
# 
# # install yesterday's version of checkpoint
# install.dates('checkpoint', Sys.Date() - 1)
# 
# # install yesterday's versions of checkpoint and devtools
# install.dates(c('checkpoint', 'devtools'), Sys.Date() - 1)
# 
# # install yesterday's version of checkpoint and the day before's devtools
# install.dates(c('checkpoint', 'devtools'), Sys.Date() - 1:2)
# 
# ## End(Not run)

Run the code above in your browser using DataLab