Running 'spelling.R'
  Running 'testthat.R'
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(marginaleffects)
  > library(margins)
  > 
  > test_check("marginaleffects")
  Starting 2 test processes
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • AER cannot be loaded (1)
  • On CRAN (8)
  • cmdstanr cannot be loaded (1)
  • gam: marginalmeans != emmeans (1)
  • https://github.com/vincentarelbundock/marginaleffects/issues/160 (2)
  • ivreg cannot be loaded (1)
  • lme4 cannot be loaded (1)
  • rstanarm cannot be loaded (1)
  • unsupported data argument in get_predicted.lrm (1)
  • works interactively (6)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test-pkg-MASS.R:198:5): glmmPQL: no validity ─────────────────────────
  Error: Package 'lme4' is required for this function to work.
    Please install it by running install.packages('lme4').
  Backtrace:
      █
   1. └─marginaleffects:::expect_marginaleffects(...)
   2.   └─marginaleffects::marginaleffects(object, type = type) C:\r_packages\pkgcheck\CRAN\marginaleffects\marginaleffects.Rcheck\tests\testthat\helper-marginaleffects.R:15:2
   3.     └─marginaleffects:::sanitize_vcov(model, vcov)
   4.       ├─marginaleffects::get_coef(model)
   5.       └─marginaleffects:::get_coef.default(model)
   6.         ├─insight::get_parameters(model)
   7.         └─insight:::get_parameters.lme(model)
   8.           └─insight::check_if_installed("lme4")
  ── Error (test-pkg-estimatr.R:7:5): iv_robust vs. stata ────────────────────────
  <packageNotFoundError/error/condition>
  Error in `find.package(package, lib.loc, verbose = verbose)`: there is no package called 'ivreg'
  Backtrace:
      █
   1. └─utils::data(Kmenta, package = "ivreg")
   2.   └─base::find.package(package, lib.loc, verbose = verbose)
  ── Error (test-pkg-estimatr.R:46:5): iv_robust: predictions: no validity ───────
  <packageNotFoundError/error/condition>
  Error in `find.package(package, lib.loc, verbose = verbose)`: there is no package called 'ivreg'
  Backtrace:
      █
   1. └─utils::data(Kmenta, package = "ivreg")
   2.   └─base::find.package(package, lib.loc, verbose = verbose)
  
  [ FAIL 3 | WARN 0 | SKIP 23 | PASS 421 ]
  Error: Test failures
  Execution halted