Running ‘testthat.R’ [7s/9s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(modmarg)
  > 
  > test_check("modmarg")
  ── 1. Error: 2sls coefficients and standard errors are correct (@test_ivreg.R#33
  there is no package called 'AER'
  1: AER::ivreg at testthat/test_ivreg.R:33
  2: getExportedValue(pkg, name)
  3: asNamespace(ns)
  4: getNamespace(ns)
  5: tryCatch(loadNamespace(name), error = function(e) stop(e))
  6: tryCatchList(expr, classes, parentenv, handlers)
  7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  8: value[[3L]](cond)
  
  ── 2. Error: 2SLS margins are correct (@test_ivreg.R#72)  ──────────────────────
  there is no package called 'AER'
  1: AER::ivreg at testthat/test_ivreg.R:72
  2: getExportedValue(pkg, name)
  3: asNamespace(ns)
  4: getNamespace(ns)
  5: tryCatch(loadNamespace(name), error = function(e) stop(e))
  6: tryCatchList(expr, classes, parentenv, handlers)
  7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  8: value[[3L]](cond)
  
  ── 3. Error: 2SLS margins handle weights (@test_ivreg.R#135)  ──────────────────
  there is no package called 'AER'
  1: AER::ivreg at testthat/test_ivreg.R:135
  2: getExportedValue(pkg, name)
  3: asNamespace(ns)
  4: getNamespace(ns)
  5: tryCatch(loadNamespace(name), error = function(e) stop(e))
  6: tryCatchList(expr, classes, parentenv, handlers)
  7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  8: value[[3L]](cond)
  
  ── 4. Error: 2SLS margins warn if weights are absent (@test_ivreg.R#201)  ──────
  there is no package called 'AER'
  1: AER::ivreg at testthat/test_ivreg.R:201
  2: getExportedValue(pkg, name)
  3: asNamespace(ns)
  4: getNamespace(ns)
  5: tryCatch(loadNamespace(name), error = function(e) stop(e))
  6: tryCatchList(expr, classes, parentenv, handlers)
  7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  8: value[[3L]](cond)
  
  ── 5. Error: 2SLS margins handle missing covariates (@test_ivreg.R#223)  ───────
  there is no package called 'AER'
  1: AER::ivreg at testthat/test_ivreg.R:223
  2: getExportedValue(pkg, name)
  3: asNamespace(ns)
  4: getNamespace(ns)
  5: tryCatch(loadNamespace(name), error = function(e) stop(e))
  6: tryCatchList(expr, classes, parentenv, handlers)
  7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  8: value[[3L]](cond)
  
  ── 6. Error: 2SLS margins handle missing weights (@test_ivreg.R#281)  ──────────
  there is no package called 'AER'
  1: AER::ivreg at testthat/test_ivreg.R:281
  2: getExportedValue(pkg, name)
  3: asNamespace(ns)
  4: getNamespace(ns)
  5: tryCatch(loadNamespace(name), error = function(e) stop(e))
  6: tryCatchList(expr, classes, parentenv, handlers)
  7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  8: value[[3L]](cond)
  
  ── 7. Error: 2SLS margins handle missing weights and covariates (@test_ivreg.R#3
  there is no package called 'AER'
  1: AER::ivreg at testthat/test_ivreg.R:349
  2: getExportedValue(pkg, name)
  3: asNamespace(ns)
  4: getNamespace(ns)
  5: tryCatch(loadNamespace(name), error = function(e) stop(e))
  6: tryCatchList(expr, classes, parentenv, handlers)
  7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  8: value[[3L]](cond)
  
  ── 8. Error: P values are calculated correctly (@test_ivreg.R#418)  ────────────
  there is no package called 'AER'
  1: AER::ivreg at testthat/test_ivreg.R:418
  2: getExportedValue(pkg, name)
  3: asNamespace(ns)
  4: getNamespace(ns)
  5: tryCatch(loadNamespace(name), error = function(e) stop(e))
  6: tryCatchList(expr, classes, parentenv, handlers)
  7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  8: value[[3L]](cond)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 219 SKIPPED: 0 FAILED: 8
  1. Error: 2sls coefficients and standard errors are correct (@test_ivreg.R#33) 
  2. Error: 2SLS margins are correct (@test_ivreg.R#72) 
  3. Error: 2SLS margins handle weights (@test_ivreg.R#135) 
  4. Error: 2SLS margins warn if weights are absent (@test_ivreg.R#201) 
  5. Error: 2SLS margins handle missing covariates (@test_ivreg.R#223) 
  6. Error: 2SLS margins handle missing weights (@test_ivreg.R#281) 
  7. Error: 2SLS margins handle missing weights and covariates (@test_ivreg.R#349) 
  8. Error: P values are calculated correctly (@test_ivreg.R#418) 
  
  Error: testthat unit tests failed
  Execution halted