Running 'testthat.R'
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > Sys.unsetenv("R_TESTS")
  > if (require(testthat, quietly = TRUE)) {
  +   require(stan4bart)
  +   test_check("stan4bart")
  + } else {
  +   cat("package 'testthat' not available; cannot run unit tests\n")
  + }
  Loading required package: stan4bart
  Loading required package: dbarts
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • On CRAN (2)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test-01-continuous.R:16:1): (code run outside of `test_that()`) ──────
  <packageNotFoundError/error/condition>
  Error in `loadNamespace(x)`: there is no package called 'lme4'
  Backtrace:
      █
   1. ├─stan4bart::stan4bart(...) test-01-continuous.R:16:0
   2. │ └─stan4bart:::make_glmerControl()
   3. └─base::loadNamespace(x)
   4.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5.     └─base:::withOneRestart(expr, restarts[[1L]])
   6.       └─base:::doWithOneRestart(return(expr), restart)
  ── Error (test-02-binary.R:15:3): extract matches fitted in causal setting model ──
  <packageNotFoundError/error/condition>
  Error in `loadNamespace(x)`: there is no package called 'lme4'
  Backtrace:
      █
   1. ├─stan4bart::stan4bart(...) test-02-binary.R:15:2
   2. │ └─stan4bart:::make_glmerControl()
   3. └─base::loadNamespace(x)
   4.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5.     └─base:::withOneRestart(expr, restarts[[1L]])
   6.       └─base:::doWithOneRestart(return(expr), restart)
  ── Error (test-02-binary.R:85:3): predict matches supplied data ────────────────
  <packageNotFoundError/error/condition>
  Error in `loadNamespace(x)`: there is no package called 'lme4'
  Backtrace:
      █
   1. ├─stan4bart::stan4bart(...) test-02-binary.R:85:2
   2. │ └─stan4bart:::make_glmerControl()
   3. └─base::loadNamespace(x)
   4.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5.     └─base:::withOneRestart(expr, restarts[[1L]])
   6.       └─base:::doWithOneRestart(return(expr), restart)
  ── Error (test-03-na_action.R:24:3): na.action = na.omit works correctly ───────
  <packageNotFoundError/error/condition>
  Error in `loadNamespace(x)`: there is no package called 'lme4'
  Backtrace:
      █
   1. ├─stan4bart::stan4bart(...) test-03-na_action.R:24:2
   2. │ └─stan4bart:::make_glmerControl()
   3. └─base::loadNamespace(x)
   4.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5.     └─base:::withOneRestart(expr, restarts[[1L]])
   6.       └─base:::doWithOneRestart(return(expr), restart)
  ── Error (test-03-na_action.R:46:3): na.action = na.exclude works correctly ────
  <packageNotFoundError/error/condition>
  Error in `loadNamespace(x)`: there is no package called 'lme4'
  Backtrace:
      █
   1. ├─stan4bart::stan4bart(...) test-03-na_action.R:46:2
   2. │ └─stan4bart:::make_glmerControl()
   3. └─base::loadNamespace(x)
   4.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5.     └─base:::withOneRestart(expr, restarts[[1L]])
   6.       └─base:::doWithOneRestart(return(expr), restart)
  ── Error (test-04-factor_levels.R:21:3): model fits with empty factor levels ───
  <packageNotFoundError/error/condition>
  Error in `loadNamespace(x)`: there is no package called 'lme4'
  Backtrace:
      █
   1. ├─stan4bart::stan4bart(...) test-04-factor_levels.R:21:2
   2. │ └─stan4bart:::make_glmerControl()
   3. └─base::loadNamespace(x)
   4.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5.     └─base:::withOneRestart(expr, restarts[[1L]])
   6.       └─base:::doWithOneRestart(return(expr), restart)
  ── Error (test-05-rng.R:13:3): stan4bart with global seed and one thread is reproducible ──
  <packageNotFoundError/error/condition>
  Error in `loadNamespace(x)`: there is no package called 'lme4'
  Backtrace:
      █
   1. ├─stan4bart::stan4bart(...) test-05-rng.R:13:2
   2. │ └─stan4bart:::make_glmerControl()
   3. └─base::loadNamespace(x)
   4.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5.     └─base:::withOneRestart(expr, restarts[[1L]])
   6.       └─base:::doWithOneRestart(return(expr), restart)
  ── Error (test-05-rng.R:30:3): stan4bart with fixed seed is reproducible ───────
  <packageNotFoundError/error/condition>
  Error in `loadNamespace(x)`: there is no package called 'lme4'
  Backtrace:
      █
   1. ├─stan4bart::stan4bart(...) test-05-rng.R:30:2
   2. │ └─stan4bart:::make_glmerControl()
   3. └─base::loadNamespace(x)
   4.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5.     └─base:::withOneRestart(expr, restarts[[1L]])
   6.       └─base:::doWithOneRestart(return(expr), restart)
  ── Error (test-06-no_ranef.R:17:3): fit issues warning if overparameterized ────
  <packageNotFoundError/error/condition>
  Error in `loadNamespace(x)`: there is no package called 'lme4'
  Backtrace:
       █
    1. ├─testthat::expect_warning(...) test-06-no_ranef.R:17:2
    2. │ └─testthat:::quasi_capture(enquo(object), label, capture_warnings)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. ├─stan4bart::stan4bart(...)
    7. │ └─stan4bart:::make_glmerControl()
    8. └─base::loadNamespace(x)
    9.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   10.     └─base:::withOneRestart(expr, restarts[[1L]])
   11.       └─base:::doWithOneRestart(return(expr), restart)
  ── Error (test-06-no_ranef.R:23:1): (code run outside of `test_that()`) ────────
  <packageNotFoundError/error/condition>
  Error in `loadNamespace(x)`: there is no package called 'lme4'
  Backtrace:
      █
   1. ├─stan4bart::stan4bart(...) test-06-no_ranef.R:23:0
   2. │ └─stan4bart:::make_glmerControl()
   3. └─base::loadNamespace(x)
   4.   └─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5.     └─base:::withOneRestart(expr, restarts[[1L]])
   6.       └─base:::doWithOneRestart(return(expr), restart)
  
  [ FAIL 10 | WARN 0 | SKIP 2 | PASS 0 ]
  Error: Test failures
  Execution halted