
The script that checks whether the installed packages load
Source:R/reproducibility_check.R
dot-repro_load_check_lines.RdOnly the packages the scripts load are installed at their recorded versions,
next to the current versions of everything else. An old version can then keep
another package from loading (a current ggplot2 next to a recorded scales
stopped with "namespace 'scales' 1.2.1 is being loaded, but >= 1.4.0 is
required"), or crash R when a current package uses it (a recorded magrittr
crashed library(tidyverse) on R 4.6.1). Both were found in real repositories.
Arguments
- lib
the library the packages were installed in
- pkgs
the packages the scripts load
- recorded
the packages installed at a recorded version
- results_file
where the script saves its results, after every package: a list of
set_aside(package,because,version_installed,note) andnot_loading(package,message)
Details
The script loads each package in a new R process, so a crash stops only that process, and a namespace that an earlier package loaded does not hide a fault. When a package does not load, a recorded version is set aside, so the current version is used: the one the error names, or else the first recorded package it depends on (or the package itself) without which it loads. A package that does not load without them either is reported, and nothing is set aside for it. The script runs without this package, in a container or in a new process, and works from R 3.6.