Running ‘testthat.R’ [6s/10s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(bayesMeanScale)
  > 
  > test_check("bayesMeanScale")
  [ FAIL 38 | WARN 0 | SKIP 0 | PASS 55 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-bayes-count-marg-effects.R:5:3'): make sure all configurations of bayesCountMargEffF run without error ──
  Expected `bayesCountMargEffF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-count-marg-effects.R:6:3'): make sure all configurations of bayesCountMargEffF run without error ──
  Expected `bayesCountMargEffF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-count-marg-effects.R:7:3'): make sure all configurations of bayesCountMargEffF run without error ──
  Expected `bayesCountMargEffF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-count-marg-effects.R:8:3'): make sure all configurations of bayesCountMargEffF run without error ──
  Expected `bayesCountMargEffF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-count-marg-effects.R:9:3'): make sure all configurations of bayesCountMargEffF run without error ──
  Expected `bayesCountMargEffF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-count-marg-effects.R:11:3'): make sure all configurations of bayesCountMargEffF run without error ──
  Expected `bayesCountMargEffF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-count-marg-effects.R:12:3'): make sure all configurations of bayesCountMargEffF run without error ──
  Expected `bayesCountMargEffF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-count-marg-effects.R:13:3'): make sure all configurations of bayesCountMargEffF run without error ──
  Expected `bayesCountMargEffF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-count-marg-effects.R:14:3'): make sure all configurations of bayesCountMargEffF run without error ──
  Expected `bayesCountMargEffF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-count-marg-effects.R:15:3'): make sure all configurations of bayesCountMargEffF run without error ──
  Expected `bayesCountMargEffF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Error ('test-bayes-count-marg-effects.R:21:3'): make sure all configurations of bayesCountMargEffF run without warning ──
  Error in `as.data.frame.default(x, ...)`: cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  Backtrace:
       ▆
    1. ├─testthat::expect_no_warning(...) at test-bayes-count-marg-effects.R:21:3
    2. │ └─testthat:::expect_no_(...)
    3. │   └─testthat:::quasi_capture(enquo(object), NULL, capture)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─rlang::try_fetch(...)
    6. │     │   └─base::withCallingHandlers(...)
    7. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    8. └─bayesMeanScale::bayesCountMargEffF(...)
    9.   └─bayesMeanScale:::meanCountPredF(...)
   10.     ├─data.table::as.data.table(model)
   11.     └─data.table:::as.data.table.default(model)
   12.       ├─data.table::as.data.table(as.data.frame(x, ...), ...)
   13.       ├─base::as.data.frame(x, ...)
   14.       └─base::as.data.frame.default(x, ...)
  ── Failure ('test-bayes-count-preds.R:5:3'): make sure all configurations of bayesCountPredsF run without error ──
  Expected `bayesCountPredsF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-count-preds.R:6:3'): make sure all configurations of bayesCountPredsF run without error ──
  Expected `bayesCountPredsF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-count-preds.R:7:3'): make sure all configurations of bayesCountPredsF run without error ──
  Expected `bayesCountPredsF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-count-preds.R:8:3'): make sure all configurations of bayesCountPredsF run without error ──
  Expected `bayesCountPredsF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-count-preds.R:9:3'): make sure all configurations of bayesCountPredsF run without error ──
  Expected `bayesCountPredsF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-count-preds.R:11:3'): make sure all configurations of bayesCountPredsF run without error ──
  Expected `bayesCountPredsF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-count-preds.R:12:3'): make sure all configurations of bayesCountPredsF run without error ──
  Expected `bayesCountPredsF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-count-preds.R:13:3'): make sure all configurations of bayesCountPredsF run without error ──
  Expected `bayesCountPredsF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-count-preds.R:14:3'): make sure all configurations of bayesCountPredsF run without error ──
  Expected `bayesCountPredsF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-count-preds.R:15:3'): make sure all configurations of bayesCountPredsF run without error ──
  Expected `bayesCountPredsF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Error ('test-bayes-count-preds.R:21:3'): make sure all configurations of bayesCountPredsF run without warning ──
  Error in `as.data.frame.default(x, ...)`: cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  Backtrace:
       ▆
    1. ├─testthat::expect_no_warning(...) at test-bayes-count-preds.R:21:3
    2. │ └─testthat:::expect_no_(...)
    3. │   └─testthat:::quasi_capture(enquo(object), NULL, capture)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─rlang::try_fetch(...)
    6. │     │   └─base::withCallingHandlers(...)
    7. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    8. └─bayesMeanScale::bayesCountPredsF(...)
    9.   └─bayesMeanScale:::meanCountPredF(...)
   10.     ├─data.table::as.data.table(model)
   11.     └─data.table:::as.data.table.default(model)
   12.       ├─data.table::as.data.table(as.data.frame(x, ...), ...)
   13.       ├─base::as.data.frame(x, ...)
   14.       └─base::as.data.frame.default(x, ...)
  ── Error ('test-bayes-count-preds.R:37:1'): (code run outside of `test_that()`) ──
  Error in `as.data.frame.default(x, ...)`: cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  Backtrace:
      ▆
   1. ├─... %>% subset(., select = c(mean)) at test-bayes-count-preds.R:37:1
   2. ├─base::subset(., select = c(mean))
   3. └─bayesMeanScale::bayesCountPredsF(...)
   4.   └─bayesMeanScale:::meanCountPredF(...)
   5.     ├─data.table::as.data.table(model)
   6.     └─data.table:::as.data.table.default(model)
   7.       ├─data.table::as.data.table(as.data.frame(x, ...), ...)
   8.       ├─base::as.data.frame(x, ...)
   9.       └─base::as.data.frame.default(x, ...)
  ── Failure ('test-bayes-preds.R:5:3'): make sure all configurations of bayesPredsF run without error ──
  Expected `bayesPredsF(logitModel2, at = list(educ = c(0, 12)), n_draws = 500)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-preds.R:6:3'): make sure all configurations of bayesPredsF run without error ──
  Expected `bayesPredsF(logitModel, at = list(educ = c(0, 12)), n_draws = 500)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-preds.R:7:3'): make sure all configurations of bayesPredsF run without error ──
  Expected `bayesPredsF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-preds.R:8:3'): make sure all configurations of bayesPredsF run without error ──
  Expected `bayesPredsF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-bayes-preds.R:9:3'): make sure all configurations of bayesPredsF run without error ──
  Expected `bayesPredsF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Error ('test-bayes-preds.R:15:3'): make sure all configurations of bayesPredsF run without warning ──
  Error in `as.data.frame.default(x, ...)`: cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  Backtrace:
       ▆
    1. ├─testthat::expect_no_warning(...) at test-bayes-preds.R:15:3
    2. │ └─testthat:::expect_no_(...)
    3. │   └─testthat:::quasi_capture(enquo(object), NULL, capture)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─rlang::try_fetch(...)
    6. │     │   └─base::withCallingHandlers(...)
    7. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    8. └─bayesMeanScale::bayesPredsF(...)
    9.   └─bayesMeanScale:::meanPredF(...)
   10.     ├─data.table::as.data.table(model)
   11.     └─data.table:::as.data.table.default(model)
   12.       ├─data.table::as.data.table(as.data.frame(x, ...), ...)
   13.       ├─base::as.data.frame(x, ...)
   14.       └─base::as.data.frame.default(x, ...)
  ── Error ('test-marg-compare-error-check.R:3:1'): (code run outside of `test_that()`) ──
  Error in `as.data.frame.default(x, ...)`: cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  Backtrace:
      ▆
   1. └─bayesMeanScale::bayesMargEffF(...) at test-marg-compare-error-check.R:3:1
   2.   └─bayesMeanScale:::meanPredF(...)
   3.     ├─data.table::as.data.table(model)
   4.     └─data.table:::as.data.table.default(model)
   5.       ├─data.table::as.data.table(as.data.frame(x, ...), ...)
   6.       ├─base::as.data.frame(x, ...)
   7.       └─base::as.data.frame.default(x, ...)
  ── Error ('test-marg-compare.R:2:1'): (code run outside of `test_that()`) ──────
  Error in `as.data.frame.default(x, ...)`: cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  Backtrace:
      ▆
   1. └─bayesMeanScale::bayesMargEffF(...) at test-marg-compare.R:2:1
   2.   └─bayesMeanScale:::meanPredF(...)
   3.     ├─data.table::as.data.table(model)
   4.     └─data.table:::as.data.table.default(model)
   5.       ├─data.table::as.data.table(as.data.frame(x, ...), ...)
   6.       ├─base::as.data.frame(x, ...)
   7.       └─base::as.data.frame.default(x, ...)
  ── Failure ('test-marg-effects.R:5:3'): make sure all configurations of bayesMargEffF run without error ──
  Expected `bayesMargEffF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-marg-effects.R:6:3'): make sure all configurations of bayesMargEffF run without error ──
  Expected `bayesMargEffF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-marg-effects.R:7:3'): make sure all configurations of bayesMargEffF run without error ──
  Expected `bayesMargEffF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-marg-effects.R:8:3'): make sure all configurations of bayesMargEffF run without error ──
  Expected `bayesMargEffF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Failure ('test-marg-effects.R:9:3'): make sure all configurations of bayesMargEffF run without error ──
  Expected `bayesMargEffF(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  ── Error ('test-marg-effects.R:15:3'): make sure all configurations of bayesMargEffF run without warning ──
  Error in `as.data.frame.default(x, ...)`: cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  Backtrace:
       ▆
    1. ├─testthat::expect_no_warning(...) at test-marg-effects.R:15:3
    2. │ └─testthat:::expect_no_(...)
    3. │   └─testthat:::quasi_capture(enquo(object), NULL, capture)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─rlang::try_fetch(...)
    6. │     │   └─base::withCallingHandlers(...)
    7. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    8. └─bayesMeanScale::bayesMargEffF(...)
    9.   └─bayesMeanScale:::meanPredF(...)
   10.     ├─data.table::as.data.table(model)
   11.     └─data.table:::as.data.table.default(model)
   12.       ├─data.table::as.data.table(as.data.frame(x, ...), ...)
   13.       ├─base::as.data.frame(x, ...)
   14.       └─base::as.data.frame.default(x, ...)
  ── Error ('test-marg-effects.R:25:1'): (code run outside of `test_that()`) ─────
  Error in `as.data.frame.default(x, ...)`: cannot coerce class 'c("stanreg", "glm", "lm")' to a data.frame
  Backtrace:
      ▆
   1. ├─... %>% subset(., select = c(mean)) at test-marg-effects.R:25:1
   2. ├─base::subset(., select = c(mean))
   3. └─bayesMeanScale::bayesMargEffF(...)
   4.   └─bayesMeanScale:::meanPredF(...)
   5.     ├─data.table::as.data.table(model)
   6.     └─data.table:::as.data.table.default(model)
   7.       ├─data.table::as.data.table(as.data.frame(x, ...), ...)
   8.       ├─base::as.data.frame(x, ...)
   9.       └─base::as.data.frame.default(x, ...)
  
  [ FAIL 38 | WARN 0 | SKIP 0 | PASS 55 ]
  Error: Test failures
  Execution halted