install {dateback}R Documentation

Collect and install source packages on a specified date with dependencies

Description

Collect and install source packages on a specified date with dependencies.

install() automatically downloads and installs tar.gz files with dependencies, all of which were available on a specific day.

Downloaded contents are saved in outdir (if set) which can be used as a local repository for install.packages().

Use collect() to create a local repository without installation. See the example for details.

Usage

install(pkgs, date,
        lib = .libPaths()[1],
        repos = "https://cloud.r-project.org",
        dependencies = c("Depends", "Imports", "LinkingTo"),
        skip_installed = TRUE,
        skip_recommended = FALSE,
        outdir = NULL,
        overwrite = FALSE,
        ...
  )

collect(pkgs, date, outdir,
        repos = "https://cloud.r-project.org",
        dependencies = c("Depends", "Imports", "LinkingTo"),
        skip_installed = FALSE,
        skip_recommended = TRUE,
        overwrite = FALSE
  )

Arguments

pkgs

character vector of the names of packages.

date

character specifying a date in YYYY-MM-DD format. It tries to find the latest version of source packages on this date.

outdir

character specifying the output directory path. In install() it can be NULL to use a temporary directory. It will contain downloaded source packages, and can be used as a local package repository. See the example for details.

repos

CRAN mirror URL such as https://cloud.r-project.org.

lib

character vector of the library directories used in install.packages().

dependencies

character vector of the dependency level for additional downloads. It can include c("Depends", "Imports", "LinkingTo", "Suggests").

skip_installed

logical. If TRUE it does not collect files for packages already installed.

skip_recommended

logical. If TRUE it does not collet files for "recommended" packages.

overwrite

logical. If TRUE it overwrites existing files in outdir.

...

Arguments to be passed to install.packages()

.

Value

data.frame containing information about collected packages. Please notice that it is intended for logging, and the structure of this object may change in future releases.

Note

This package was originally developed to (partially) substitute the "CRAN Time Machine" (or "MRAN Time Machine"), which retired in July 2023 (https://blog.revolutionanalytics.com/2023/01/mran-time-machine-retired.html).

Posit Package Manager (https://packagemanager.posit.co/) has a snapshot feature, so can be used as a direct replacement for CRAN Time Machine. Windows/Mac users would greatly benefit from it since binary packages are also available.

Examples

## Not run: 

# Install 'ranger' package and its dependecies on the date 2023-03-01
dateback::install(pkgs = "ranger", date = "2023-03-01")

# Collect packages and install them later (maybe on another system)
dateback::collect(pkgs = "ranger", date = "2023-03-01", outdir = "local_repo")
install.packages(pkgs = "ranger", repos = "file:local_repo")

## End(Not run)

[Package dateback version 1.0.5 Index]