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 |
outdir |
character specifying the output directory path.
In |
repos |
CRAN mirror URL such as |
lib |
character vector of the library directories used in
|
dependencies |
character vector of the dependency level
for additional downloads. It can include
|
skip_installed |
logical. If |
skip_recommended |
logical. If |
overwrite |
logical. If |
... |
Arguments to be passed to |
.
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)