Running ‘testthat.R’ [239s/169s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > test_check("crosstable")
  Loading required package: crosstable
  
  Attaching package: 'crosstable'
  
  The following object is masked from 'package:testthat':
  
      matches
  
  Starting 2 test processes
  [ FAIL 3 | WARN 273 | SKIP 20 | PASS 324 ]
  
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • On CRAN (15)
  • On Linux (4)
  • This should only be ran manually in examples/not_test-officer_v4_legends.R (1)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test-officer.R:276:5): openxlsx is working ───────────────────────────
  <vctrs_error_incompatible_type/vctrs_error_incompatible/vctrs_error/rlang_error/error/condition>
  Error in `stop_vctrs(message, class = c(class, "vctrs_error_incompatible"), 
      x = x, y = y, details = details, ...)`: Can't convert `replace` <character> to match type of `data` <list>.
  Backtrace:
       ▆
    1. ├─crosstable::as_workbook(x2, keep_id = FALSE) at test-officer.R:276:4
    2. │ └─crosstable:::addToWorksheet(...)
    3. │   └─attr(ct, "by_levels") %>% replace_na("NA") %>% unlist()
    4. ├─base::unlist(.)
    5. ├─tidyr::replace_na(., "NA")
    6. └─tidyr:::replace_na.default(., "NA")
    7.   └─vctrs::vec_assign(data, missing, replace, x_arg = "data", value_arg = "replace")
    8.     └─vctrs `<fn>`()
    9.       └─vctrs::vec_default_cast(...)
   10.         └─vctrs::stop_incompatible_cast(...)
   11.           └─vctrs::stop_incompatible_type(...)
   12.             └─vctrs:::stop_incompatible(...)
   13.               └─vctrs:::stop_vctrs(...)
   14.                 └─rlang::abort(message, class = c(class, "vctrs_error"), ...)
  ── Failure (test-selection.R:52:5): crosstable with external character vector ──
  `.` produced warnings.
  Backtrace:
      ▆
   1. ├─... %>% expect_silent() at test-selection.R:52:4
   2. └─testthat::expect_silent(.)
  ── Failure (test-selection.R:57:5): crosstable with external character vector ──
  `.` produced warnings.
  Backtrace:
      ▆
   1. ├─... %>% expect_silent() at test-selection.R:57:4
   2. └─testthat::expect_silent(.)
  
  [ FAIL 3 | WARN 273 | SKIP 20 | PASS 324 ]
  Error: Test failures
  Execution halted