Running ‘testthat.R’ [193s/217s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(vdiffr)
  > library(plotBart)
  Loading required package: bartCause
  Loading required package: ggplot2
  > 
  > test_check("plotBart") # run tests
  fitting treatment model via method 'bart'
  fitting response model via method 'bart'
  fitting treatment model via method 'bart'
  fitting response model via method 'bart'
  fitting treatment model via method 'bart'
  fitting response model via method 'bart'
  Saving _problems/test_plots-20.R
  [ FAIL 1 | WARN 3 | SKIP 0 | PASS 5 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test_plots.R:20:1'): (code run outside of `test_that()`) ────────────
  Error in `summarize(., diff = mean - lag(mean), .groups = "drop")`: ℹ In argument: `diff = mean - lag(mean)`.
  ℹ In group 1: `name = "age"`.
  Caused by error:
  ! `diff` must be size 1, not 2.
  ℹ To return more or less than 1 row per group, use `reframe()`.
  Backtrace:
       ▆
    1. ├─plotBart::plot_balance(...) at test_plots.R:20:1
    2. │ └─... %>% ggplot(aes(x = diff, y = name, color = abs(diff)))
    3. ├─ggplot2::ggplot(., aes(x = diff, y = name, color = abs(diff)))
    4. ├─stats::na.omit(.)
    5. ├─dplyr::summarize(., diff = mean - lag(mean), .groups = "drop")
    6. ├─dplyr:::summarise.grouped_df(., diff = mean - lag(mean), .groups = "drop")
    7. │ └─dplyr:::summarise_cols(.data, dplyr_quosures(...), by, "summarise")
    8. │   └─base::withCallingHandlers(...)
    9. ├─dplyr:::dplyr_internal_error(...)
   10. │ └─rlang::abort(class = c(class, "dplyr:::internal_error"), dplyr_error_data = data)
   11. │   └─rlang:::signal_abort(cnd, .file)
   12. │     └─base::signalCondition(cnd)
   13. └─dplyr (local) `<fn>`(`<dpl:::__>`)
   14.   └─dplyr (local) handler(cnd)
   15.     └─rlang::abort(message, class = error_class, parent = parent, call = error_call)
  
  [ FAIL 1 | WARN 3 | SKIP 0 | PASS 5 ]
  Deleting unused snapshots: 'plots/balance.svg', 'plots/cate.svg',
  'plots/mod-c-loess.svg', 'plots/mod-c-pd.svg', 'plots/mod-d-density.svg',
  'plots/mod-d-linerange.svg', 'plots/mod-search.svg',
  'plots/overlappscoresdensity.svg', 'plots/overlappscoreshist.svg',
  'plots/overlapvarsdensity.svg', 'plots/overlapvarshist.svg', 'plots/pate.svg',
  'plots/sate.svg', 'plots/supportchi.svg', 'plots/supportnone.svg',
  'plots/supportsd.svg', 'plots/trace.svg', 'plots/waterfall1.svg', and
  'plots/waterfall2.svg'
  Error:
  ! Test failures.
  Execution halted