Rock Solid Package Installation for Legacy R Versions
Status
lines of R code: 299, lines of test code: 0
Version
0.2.3 ( 2020-08-19 20:27:40 )
Description
Make sure packages are available at runtime without any setup. Package installation, reproducibility and exchanging code can be frunstrating especially if code is used on older R versions. Often it is hard to puzzle out which package versions are able to work together after some years have passed and packages evolved further and further. The ‘wayback’ package aims to make this process as painless and robust as possible by using ‘MRAN’s ’CRAN’ snapshots to build local package libraries from way back.
License
GPL-3
Peter Meissner [aut, cre], virtual7
[cph]
Citation
citation("wayback")
Meissner P (2020). wayback: Rock Solid Package Installation for Legacy R Versions. R package version 0.2.3.
BibTeX for citing
BibTeX(citation("wayback"))
@Manual{,
title = {wayback: Rock Solid Package Installation for Legacy R Versions},
author = {Peter Meissner},
year = {2020},
note = {R package version 0.2.3},
}
Installation
Stable version from CRAN:
install.packages("wayback")
Package Usage
library(wayback)
The main function of the package is wb_require()
. Once {wayback}
is
installed this function allows to have required packages loaded from a
library specified. In addition wb_require()
will install packages that
are not present but required.
The real core strength and purpose of the package is to install packages
and dependencies from a specific point in time. This is provided by the
date
parameter allowing to go back in time - especially to a point in
time where known to have consistent states of packages and dependencies
for a given version of R.
suppressPackageStartupMessages(
wb_require(
pkg = "glue",
date = Sys.Date(),
library_path = "./r_package_library"
)
)
## loaded glue
info <- packageDescription("glue", lib.loc = "./r_package_library")
info$Packaged
## [1] "2020-05-13 14:58:42 UTC; jhester"
Package Use Cases and Scope
Package Maxims and Trade Offs
- given
{wayback}
is installed everything else should just work {wayback}
will not change how your session works - e.g. normalinstall.packages()
will work the same with and without{wayback}
- given that no date is provided the parameter
date
will default to 60 days after the currently used R version’s publication date {wayback}
will not install anything if the required package is already found in the current path- if however a explicit library path is provided - best practice -
than
{wayback}
will assume that all packages and all dependencies- except base R packages - should come from this source
- dependencies are important:
{wayback}
will forcefully install dependencies - providing a function that does package loading and installation is
less ‘save’ than the standard usage of
library()
on the other hand this is common practice and{wayback}
scratches this itch in hope to provide a solid, effective and robust solution to the problem - behaviour should - by default - stem from function parameters only
- to minimize re-writing function parameters over and over again all function parameters can be set via options