Running ‘spelling.R’ [0s/1s]
  Running ‘testthat.R’ [270s/209s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(marginaleffects)
  > library(margins)
  > 
  > test_check("marginaleffects")
  Starting 2 test processes
  [ FAIL 2 | WARN 8 | SKIP 26 | PASS 504 ]
  
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • 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 (2)
  • lmerTest cannot be loaded (1)
  • modelbased cannot be loaded (1)
  • unsupported data argument in get_predicted.lrm (1)
  • works interactively (8)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test-pkg-survival.R:14:5): coxph vs. Stata ───────────────────────────
  Error in `model.frame.default(data = newdata, formula = ~x + strata(sex), 
      na.action = function (object, ...) 
      object, xlev = list(`strata(sex)` = c("sex=0", "sex=1")))`: factor strata(sex) has new levels 0, 1
  Backtrace:
       ▆
    1. ├─base::merge(tidy(marginaleffects(mod, type = "lp")), stata) at test-pkg-survival.R:14:4
    2. ├─generics::tidy(marginaleffects(mod, type = "lp"))
    3. └─marginaleffects::marginaleffects(mod, type = "lp")
    4.   └─marginaleffects:::get_dydx(...)
    5.     └─marginaleffects dydx_fun(...)
    6.       └─marginaleffects:::get_gradient(func = inner, x = newdata[[variable]])
    7.         └─marginaleffects func(x + eps)
    8.           ├─marginaleffects::get_predict(...)
    9.           └─marginaleffects:::get_predict.coxph(...)
   10.             ├─stats::predict(model, newdata = newdata, type = type, ...)
   11.             ├─survival:::predict.coxph(...)
   12.             │ └─base::eval(tcall, parent.frame())
   13.             │   └─base::eval(tcall, parent.frame())
   14.             ├─stats::model.frame(...)
   15.             └─stats::model.frame.default(...)
  ── Failure (test-tidy.R:45:5): glance: with modelsummary ───────────────────────
  dim(glance(mfx)) (`actual`) not equal to c(1, 9) (`expected`).
  
    `actual`: 1 10
  `expected`: 1  9
  
  [ FAIL 2 | WARN 8 | SKIP 26 | PASS 504 ]
  Error: Test failures
  Execution halted