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
  [ FAIL 1 | WARN 8 | SKIP 24 | PASS 542 ]
  
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • Installed insight is version 0.16.0; but 0.16.1 is required (1)
  • On CRAN (9)
  • cmdstanr cannot be loaded (1)
  • emmeans does not support (1)
  • gam: marginalmeans != emmeans (1)
  • https://github.com/easystats/insight/issues/441 (1)
  • https://github.com/vincentarelbundock/marginaleffects/issues/160 (1)
  • unsupported data argument in get_predicted.lrm (1)
  • works interactively (8)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test-newdata.R:11:5): visualisation_matrix() without `x` variable ────
  Error in `model.frame.default(Terms, newdata, na.action = na.action, xlev = object$xlevels)`: factor factor(cyl) has new levels 4.0001, 6.0001, 8.0001
  Backtrace:
       ▆
    1. └─marginaleffects::marginaleffects(mod, newdata = visualisation_matrix(at = "cyl")) at test-newdata.R:11:4
    2.   └─marginaleffects:::get_dydx(...)
    3.     └─marginaleffects dydx_fun(...)
    4.       └─marginaleffects:::get_gradient(func = inner, x = newdata[[variable]])
    5.         └─marginaleffects func(x + eps)
    6.           ├─marginaleffects::get_predict(...)
    7.           └─marginaleffects:::get_predict.default(...)
    8.             ├─base::do.call("fun", args)
    9.             ├─stats fun(`<lm>`, newdata = `<visualisation_matrix[,4]>`, type = "response")
   10.             └─stats::predict.lm(...)
   11.               ├─stats::model.frame(Terms, newdata, na.action = na.action, xlev = object$xlevels)
   12.               └─stats::model.frame.default(...)
  
  [ FAIL 1 | WARN 8 | SKIP 24 | PASS 542 ]
  Error: Test failures
  Execution halted