Title: | Query and Install Specific Versions of Packages on CRAN |
---|---|
Description: | Installs specified versions of R packages hosted on CRAN and provides functions to list available versions and the versions of currently installed packages. These tools can be used to help make R projects and packages more reproducible. 'versions' fits in the narrow gap between the 'devtools' install_version() function and the 'checkpoint' package. devtools::install_version() installs a stated package version from source files stored on the CRAN archives. However CRAN does not store binary versions of packages so Windows users need to have RTools installed and Windows and OSX users get longer installation times. 'checkpoint' uses the Revolution Analytics MRAN server to install packages (from source or binary) as they were available on a given date. It also provides a helpful interface to detect the packages in use in a directory and install all of those packages for a given date. 'checkpoint' doesn't provide install.packages-like functionality however, and that's what 'versions' aims to do, by querying MRAN. As MRAN only goes back to 2014-09-17, 'versions' can't install packages archived before this date. |
Authors: | Nick Golding |
Maintainer: | Nick Golding <[email protected]> |
License: | BSD_3_clause + file LICENSE |
Version: | 0.4 |
Built: | 2024-12-18 05:09:40 UTC |
Source: | https://github.com/goldingn/versions |
Installs specified versions of R packages
hosted on CRAN and provides functions to list available versions and the
versions of currently installed packages. These tools can be used to help
make R projects and packages more reproducible.
versions
fits in the narrow gap between the devtools
install_version
function and the checkpoint
package.
devtools::install_version
installs a stated package version from
source files stored on the CRAN archives. However CRAN does not store
binary versions of packages so Windows users need to have RTools installed
and Windows and OSX users get longer installation times.
checkpoint
uses the Revolution Analytics MRAN server to
install packages (from source or binary) as they were available on
a given date. It also provides a helpful interface to detect the packages
in use in a directory and install all of those packages for a given date.
checkpoint
doesn't provide install.packages
-like functionality
however, and that's what versions
aims to do, by querying MRAN.
As MRAN only goes back to 2014-09-17, versions
can't install packages
from before this date.
The available functions are:
The URL for MRAN may change from time to time. As of versions
0.4, the URL is https://cran.microsoft.com/snapshot, and this is what
the package uses. If the MRAN server URL changes before versions
can
be updated, users can point versions to the new URL via the option
'versions.mran'. Ie. options(versions.mran = "<some/new/url>")
## Not run: # list the available versions of checkpoint available.versions('checkpoint') # install a specific version install.versions('checkpoint', '0.3.9') # check the installed version installed.versions('versions') # install checkpoint as of a specific date install.dates('checkpoint', '2014-12-25') ## End(Not run)
## Not run: # list the available versions of checkpoint available.versions('checkpoint') # install a specific version install.versions('checkpoint', '0.3.9') # check the installed version installed.versions('versions') # install checkpoint as of a specific date install.dates('checkpoint', '2014-12-25') ## End(Not run)
List all of the past versions of the named packages ever
uploaded to CRAN (and therefore in the CRAN source archives), their
publication dates and whether they can be installed from MRAN via
install.versions
or install.dates
.
available.versions(pkgs)
available.versions(pkgs)
pkgs |
character vector of the names of packages for which to query available versions |
a list of dataframes, each giving the versions and publication dates
for the corresponding elements of pkgs
as well as whether they can be
installed from MRAN
## Not run: # available versions of checkpoint available.versions('checkpoint') # available versions of checkpoint and devtools available.versions(c('checkpoint', 'devtools')) ## End(Not run)
## Not run: # available versions of checkpoint available.versions('checkpoint') # available versions of checkpoint and devtools available.versions(c('checkpoint', 'devtools')) ## End(Not run)
Download and install the latest versions of packages hosted on CRAN as of a specific date from the MRAN server.
install.dates(pkgs, dates, lib, ...)
install.dates(pkgs, dates, lib, ...)
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 |
lib |
character vector giving the library directories where to
install the packages. Recycled as needed. If missing, defaults to the
first element of |
... |
other arguments to be passed to |
## 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)
## 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)
Download and install named versions of packages hosted on CRAN from the MRAN server.
install.versions(pkgs, versions, lib, ...)
install.versions(pkgs, versions, lib, ...)
pkgs |
character vector of the names of packages that should be downloaded and installed |
versions |
character vector of the versions of packages to be
downloaded and installed. If this has the same length as |
lib |
character vector giving the library directories where to
install the packages. Recycled as needed. If missing, defaults to the
first element of |
... |
other arguments to be passed to |
## Not run: # install an earlier version of checkpoint install.versions('checkpoint', '0.3.3') # install earlier versions of checkpoint and devtools install.versions(c('checkpoint', 'devtools'), c('0.3.3', '1.6.1')) ## End(Not run)
## Not run: # install an earlier version of checkpoint install.versions('checkpoint', '0.3.3') # install earlier versions of checkpoint and devtools install.versions(c('checkpoint', 'devtools'), c('0.3.3', '1.6.1')) ## End(Not run)
List the installed versions of packages in a library directory
installed.versions(pkgs, lib)
installed.versions(pkgs, lib)
pkgs |
character vector of the names of packages for which to query the installed versions |
lib |
character vector of length one giving the library directory
containing the packages to query. If missing, defaults to the
first element of |
a named character vector of version numbers corresponding to
pkgs
, with names giving the package names. If a packakge could not be
found in lib
, an NA will be returned.
# the versions of versions installed.versions('versions') # apply to multiple packages installed.versions(c('stats', 'versions')) # add a package that doesn't exist or isn't installed # (returns NA for that one) installed.versions(c('stats', 'versions', 'notapackage'))
# the versions of versions installed.versions('versions') # apply to multiple packages installed.versions(c('stats', 'versions')) # add a package that doesn't exist or isn't installed # (returns NA for that one) installed.versions(c('stats', 'versions', 'notapackage'))