Skip to content

Require

Installing and Loading R Packages for Reproducible Workflows

v1.0.1 · Aug 17, 2024 · GPL-3

Description

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.

Downloads

469

Last 30 days

7670th

469

Last 90 days

469

Last year

CRAN Check Status

1 ERROR
10 NOTE
3 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang NOTE
r-devel-linux-x86_64-debian-gcc NOTE
r-devel-linux-x86_64-fedora-clang NOTE
r-devel-linux-x86_64-fedora-gcc NOTE
r-devel-macos-arm64 NOTE
r-devel-windows-x86_64 ERROR
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 NOTE
r-release-linux-x86_64 NOTE
r-release-macos-arm64 NOTE
r-release-macos-x86_64 NOTE
r-release-windows-x86_64 NOTE
Check details (15 non-OK)
NOTE r-devel-linux-x86_64-debian-clang

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘Require2.R’ ‘helpers.R’ ‘pak.R’ ‘pkgDep3.R’
NOTE r-devel-linux-x86_64-debian-gcc

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘Require2.R’ ‘helpers.R’ ‘pak.R’ ‘pkgDep3.R’
NOTE r-devel-linux-x86_64-fedora-clang

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘Require2.R’ ‘helpers.R’ ‘pak.R’ ‘pkgDep3.R’
NOTE r-devel-linux-x86_64-fedora-gcc

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘Require2.R’ ‘helpers.R’ ‘pak.R’ ‘pkgDep3.R’
NOTE r-devel-macos-arm64

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘Require2.R’ ‘helpers.R’ ‘pak.R’ ‘pkgDep3.R’
NOTE r-devel-windows-x86_64

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    'Require2.R' 'helpers.R' 'pak.R' 'pkgDep3.R'
ERROR r-devel-windows-x86_64

tests

  Running 'testthat.R' [95s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(Require)
  > library(testthat)
  
  Attaching package: 'testthat'
  
  The following object is masked from 'package:Require':
  
      setup
  
  > test_check("Require")
  Saving _problems/test-00pkgSnapshot_testthat-16.R
  Saving _problems/test-01packages_testthat-36.R
  Saving _problems/test-04other_testthat-19.R
  Saving _problems/test-04other_testthat-26.R
  [ FAIL 4 | WARN 0 | SKIP 7 | PASS 39 ]
  
  ══ Skipped tests (7) ═══════════════════════════════════════════════════════════
  • empty test (4): 'test-07pkgSnapshotLong_testthat.R:1:1',
    'test-08modules_testthat.R:1:1', 'test-09pkgSnapshotLong_testthat.R:1:1',
    'test-10DifferentPkgs_testthat.R:1:1'
  • On CRAN (3): 'test-05packagesLong_testthat.R:3:3',
    'test-06pkgDep_testthat.R:3:3', 'test-12offlineMode_testthat.R:4:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-00pkgSnapshot_testthat.R:16:3'): test 1 ────────────────────────
  Error in `rbindlist(l, use.names, fill, idcol, ignore.attr)`: Item 2 has 17 columns, inconsistent with item 1 which has 18 columns. To fill missing columns use fill=TRUE.
  Backtrace:
       ▆
    1. ├─base::suppressWarnings(Require(c("rlang"), require = FALSE, quiet = quiet)) at test-00pkgSnapshot_testthat.R:16:3
    2. │ └─base::withCallingHandlers(...)
    3. └─Require::Require(c("rlang"), require = FALSE, quiet = quiet)
    4.   └─Require::pkgDep(...)
    5.     └─Require:::getPkgDeps(...)
    6.       └─Require:::getDeps(...)
    7.         └─Require:::getDepsNonGH(...)
    8.           └─Require:::pkgDepCRAN(...)
    9.             └─Require:::joinToAvailablePackages(...)
   10.               └─Require:::available.packagesCached(...)
   11.                 ├─base::do.call(rbind, cap)
   12.                 └─base (local) `<fn>`(binary = `<dt[,18]>`, source = `<dt[,17]>`)
   13.                   └─data.table (local) rbind(deparse.level, ...)
   14.                     └─data.table::rbindlist(l, use.names, fill, idcol, ignore.attr)
  ── Error ('test-01packages_testthat.R:32:3'): test 1 ───────────────────────────
  Error in `rbindlist(l, use.names, fill, idcol, ignore.attr)`: Item 2 has 17 columns, inconsistent with item 1 which has 18 columns. To fill missing columns use fill=TRUE.
  Backtrace:
       ▆
    1. ├─testthat::capture_warnings(...) at test-01packages_testthat.R:32:3
    2. │ └─base::withCallingHandlers(...)
    3. ├─testthat::capture_messages(...)
    4. │ └─base::withCallingHandlers(...)
    5. └─Require::Require(...)
    6.   └─Require::pkgDep(...)
    7.     └─Require:::getPkgDeps(...)
    8.       └─Require:::getDeps(...)
    9.         └─Require:::getDepsNonGH(...)
   10.           └─Require:::pkgDepCRAN(...)
   11.             └─Require:::joinToAvailablePackages(...)
   12.               └─Require:::available.packagesCached(...)
   13.                 ├─base::do.call(rbind, cap)
   14.                 └─base (local) `<fn>`(binary = `<dt[,18]>`, source = `<dt[,17]>`)
   15.                   └─data.table (local) rbind(deparse.level, ...)
   16.                     └─data.table::rbindlist(l, use.names, fill, idcol, ignore.attr)
  ── Failure ('test-04other_testthat.R:18:3'): test 4 ────────────────────────────
  Expected `any(grepl("could not be installed", warns))` to be TRUE.
  Differences:
  `actual`:   FALSE
  `expected`: TRUE 
  
  ── Error ('test-04other_testthat.R:26:3'): test 4 ──────────────────────────────
  Error in `rbindlist(l, use.names, fill, idcol, ignore.attr)`: Item 2 has 17 columns, inconsistent with item 1 which has 18 columns. To fill missing columns use fill=TRUE.
  Backtrace:
       ▆
    1. └─Require::pkgDep("data.table", purge = FALSE) at test-04other_testthat.R:26:3
    2.   └─Require:::getPkgDeps(...)
    3.     └─Require:::getDeps(...)
    4.       └─Require:::getDepsNonGH(...)
    5.         └─Require:::pkgDepCRAN(...)
    6.           └─Require:::joinToAvailablePackages(...)
    7.             └─Require:::available.packagesCached(...)
    8.               ├─base::do.call(rbind, cap)
    9.               └─base (local) `<fn>`(binary = `<dt[,18]>`, source = `<dt[,17]>`)
   10.                 └─data.table (local) rbind(deparse.level, ...)
   11.                   └─data.table::rbindlist(l, use.names, fill, idcol, ignore.attr)
  
  [ FAIL 4 | WARN 0 | SKIP 7 | PASS 39 ]
  Error:
  ! Test failures.
  Execution halted
OK r-oldrel-macos-arm64

*


            
OK r-oldrel-macos-x86_64

*


            
OK r-oldrel-windows-x86_64

*


            
NOTE r-patched-linux-x86_64

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘Require2.R’ ‘helpers.R’ ‘pak.R’ ‘pkgDep3.R’
NOTE r-release-linux-x86_64

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘Require2.R’ ‘helpers.R’ ‘pak.R’ ‘pkgDep3.R’
NOTE r-release-macos-arm64

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘Require2.R’ ‘helpers.R’ ‘pak.R’ ‘pkgDep3.R’
NOTE r-release-macos-x86_64

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘Require2.R’ ‘helpers.R’ ‘pak.R’ ‘pkgDep3.R’
NOTE r-release-windows-x86_64

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    'Require2.R' 'helpers.R' 'pak.R' 'pkgDep3.R'

Check History

ERROR 3 OK · 10 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Mar 9, 2026
NOTE r-devel-linux-x86_64-debian-clang

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘Require2.R’ ‘helpers.R’ ‘pak.R’ ‘pkgDep3.R’
NOTE r-devel-linux-x86_64-debian-gcc

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘Require2.R’ ‘helpers.R’ ‘pak.R’ ‘pkgDep3.R’
NOTE r-devel-linux-x86_64-fedora-clang

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘Require2.R’ ‘helpers.R’ ‘pak.R’ ‘pkgDep3.R’
NOTE r-devel-linux-x86_64-fedora-gcc

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘Require2.R’ ‘helpers.R’ ‘pak.R’ ‘pkgDep3.R’
NOTE r-devel-macos-arm64

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘Require2.R’ ‘helpers.R’ ‘pak.R’ ‘pkgDep3.R’
ERROR r-devel-windows-x86_64

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    'Require2.R' 'helpers.R' 'pak.R' 'pkgDep3.R'
NOTE r-patched-linux-x86_64

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘Require2.R’ ‘helpers.R’ ‘pak.R’ ‘pkgDep3.R’
NOTE r-release-linux-x86_64

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘Require2.R’ ‘helpers.R’ ‘pak.R’ ‘pkgDep3.R’
NOTE r-release-macos-arm64

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘Require2.R’ ‘helpers.R’ ‘pak.R’ ‘pkgDep3.R’
NOTE r-release-macos-x86_64

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘Require2.R’ ‘helpers.R’ ‘pak.R’ ‘pkgDep3.R’
NOTE r-release-windows-x86_64

DESCRIPTION meta-information

  Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    'Require2.R' 'helpers.R' 'pak.R' 'pkgDep3.R'

Reverse Dependencies (1)

imports

Dependency Network

Dependencies Reverse dependencies data.table sys SpaDES.core Require

Version History

new 1.0.1 Mar 9, 2026