Package: Require 2.0.0.9021

Eliot J B McIntire

Require: Installing and Loading R Packages for Reproducible Workflows

A single key function, 'Require' that makes rerun-tolerant versions of 'install.packages' and 'require' for CRAN packages, packages no longer on CRAN (i.e., archived), specific versions of packages, and GitHub packages. This approach is developed to create reproducible workflows that are flexible and fast enough to use while in development stages, while able to build snapshots once a stable package collection is found. As with other functions in a reproducible workflow, this package emphasizes functions that return the same result whether it is the first or subsequent times running the function, with subsequent times being sufficiently fast that they can be run every time without undue waiting burden on the user or developer.

Authors:Eliot J B McIntire [aut, cre], Alex M Chubaty [ctb], His Majesty the King in Right of Canada, as represented by the Minister of Natural Resources Canada [cph]

Require_2.0.0.9021.tar.gz
Require_2.0.0.9021.zip(r-4.7)Require_2.0.0.9021.zip(r-4.6)Require_2.0.0.9021.zip(r-4.5)
Require_2.0.0.9021.tgz(r-4.6-any)Require_2.0.0.9021.tgz(r-4.5-any)
Require_2.0.0.9021.tar.gz(r-4.7-any)Require_2.0.0.9021.tar.gz(r-4.6-any)
Require_2.0.0.9021.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
Require/json (API)
NEWS

# Install 'Require' in R:
install.packages('Require', repos = c('https://predictiveecology.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/predictiveecology/require/issues

Pkgdown/docs site:https://require.predictiveecology.org

On CRAN:

Conda:

10.10 score 24 stars 14 packages 151 scripts 2.4k downloads 47 exports 7 dependencies

Last updated from:82ec011036 (on development). Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK1131
source / vignettesOK203
linux-release-x86_64OK1021
macos-release-arm64OK186
macos-oldrel-arm64OK149
windows-develOK266
windows-releaseOK240
windows-oldrelOK242
wasm-releaseOK111

Exports:.downloadFileMasterMainAuthcacheClearPackagescacheDefaultDircacheDircacheGetOptionCachePkgDircachePkgDircachePurgecheckPathclearRequirePackageCachecompareVersion2detachAlldlArchiveVersionsAvailabledlGitHubDESCRIPTIONextractInequalityextractPkgGitHubextractPkgNameextractVersionNumbergetCRANreposgetRequireOptionsInstallinvertListmessageDFmessageVerbosemodifyList2modifyList3normPathpaddedFloatToCharparseGitHubpkgDeppkgDep2pkgDepIfDepRemovedpkgDepTopoSortpkgSnapshotpkgSnapshot2purgeCacheRequireRequireOptionssetdiffNamedsetLibPathssetLinuxBinaryReposetupsetupOffsourcePkgstempdir2tempfile2trimVersionNumberupdatePackages

Dependencies:callrdata.tablepakprocessxpsR6sys

The Require approach, comparing pak and renv

Rendered fromRequire.Rmdusingknitr::rmarkdownon Jun 04 2026.

Last update: 2026-05-14
Started: 2024-07-26

Readme and manuals

Help Manual

Help pageTopics
Require: Installing and Loading R Packages for Reproducible WorkflowsRequire-package Install Require
GITHUB_PAT-aware and 'main'-'master'-aware download from GitHub.downloadFileMasterMainAuth
Partial alternative (faster) to 'installed.packages'.installed.pkgs
Create a custom "available.packages" objectavailablePackagesOverride
Needs 'VersionOnRepos', 'versionSpec' and 'inequality' columnsavailableVersionOK
Clear cached package tarballscacheClearPackages clearRequirePackageCache
The default cache directory for Require CachecacheDefaultDir
Path to (package) cache directorycacheDir cachePkgDir
Get the option for 'Require.cachePkgDir' (deprecated)cacheGetOptionCachePkgDir
Purge everything in the Require cachecachePurge purgeCache
Creates the directories, and adds version numbercheckLibPaths
Check directory pathcheckPath checkPath,character,logical-method checkPath,character,missing-method checkPath,missing,ANY-method checkPath,NULL,ANY-method
Compare package versionscompareVersion2
Only checks for deprecated libPath argument (singular)dealWithMissingLibPaths
GitHub package toolsDESCRIPTIONFileOtherV DESCRIPTIONFileVersionV dlGitHubDESCRIPTION
Detach and unload all packagesdetachAll
Available and archived versionsavailable.packagesCached dlArchiveVersionsAvailable
Deals with missing libPaths arg, and takes firstdoLibPaths
1st level -> create the .pkgEnv object in RequireenvPkgCreate
3rd level for deps #############################################envPkgDepDepsCreate
3rd level for DESCRIPTIONFileenvPkgDepDESCFileCreate
Extract info from package character stringsextractInequality extractPkgGitHub extractPkgName extractVersionNumber
The 'packages' argument may have up to 4 pieces of information for GitHub packages: name, repository, branch, version. For CRAN-alikes, it will only be 2 pieces: name, version. There can also be an inequality or equality, if there is a version.getDeps
Internet Exists queryinternetExists
Invert a 2-level listinvertList
Join a data.table with a 'Package' column to 'available.packages'joinToAvailablePackages
Create link to file, falling back to making a copy if linking fails.fileRenameOrMove linkOrCopy
This converts master or main to HEAD for a git repomasterMainToHead
Use message to print a clean square data structuremessageDF messageVerbose messageVerboseCounter
'modifyList' for multiple listsmodifyList2 modifyList3
Normalize filepathnormPath normPath,character-method normPath,list-method normPath,logical-method normPath,missing-method normPath,NULL-method
Convert numeric to character with paddingpaddedFloatToChar
2nd levelpakEnv
Parse a github package specificationparseGitHub
2nd levelpkgDepEnv
Package dependencies when one or more packages removedpkgDepIfDepRemoved
Reverse package dependspkgDep pkgDep2 pkgDepTopoSort
Take a snapshot of all the packages and version numberspkgSnapshot pkgSnapshot2
'Require' optionsgetRequireOptions RequireOptions
Recursive function to remove '.basePkgs'rmBase
R versionsrversions
Like 'setdiff', but takes into account namessetdiffNamed
Set '.libPaths'setLibPaths
Setup for binary Linux repositoriessetLinuxBinaryRepo
Setup a project library, cache, optionssetup setupOff
A list of R packages that should likely be installed from Source, not BinarysourcePkgs
'split' for a data.table that keeps integrity of a column of lists of data.table objectssplitKeepOrderAndDTIntegrity
download.files or install.packages in a separate processsysInstallAndDownload
Make a temporary (sub-)directorytempdir2
Make a temporary subfile in a temporary (sub-)directorytempfile2
Trim version number off a compound package nametrimVersionNumber
Update installed packages with latest available versionsupdatePackages