Running ‘spelling.R’ [0s/0s]
  Running ‘testthat.R’ [14s/15s]
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(simulist)
  > 
  > test_check("simulist", stop_on_warning = FALSE)
  Saving _problems/test-add_cols-187.R
  Saving _problems/test-add_cols-200.R
  Saving _problems/test-censor_linelist-2.R
  Saving _problems/test-messy_linelist-3.R
  Saving _problems/test-sim_contacts-3.R
  Saving _problems/test-sim_contacts-17.R
  Saving _problems/test-sim_contacts-31.R
  Saving _problems/test-sim_contacts-45.R
  Saving _problems/test-sim_contacts-87.R
  Saving _problems/test-sim_linelist-3.R
  Saving _problems/test-sim_linelist-25.R
  Saving _problems/test-sim_linelist-53.R
  Saving _problems/test-sim_linelist-67.R
  Saving _problems/test-sim_linelist-85.R
  Saving _problems/test-sim_linelist-108.R
  Saving _problems/test-sim_linelist-125.R
  Saving _problems/test-sim_linelist-159.R
  Saving _problems/test-sim_linelist-175.R
  Saving _problems/test-sim_linelist-190.R
  Saving _problems/test-sim_linelist-249.R
  Saving _problems/test-sim_linelist-365.R
  Saving _problems/test-sim_linelist-391.R
  Saving _problems/test-sim_linelist-419.R
  Saving _problems/test-sim_linelist-440.R
  Saving _problems/test-sim_outbreak-3.R
  Saving _problems/test-sim_outbreak-26.R
  Saving _problems/test-sim_outbreak-40.R
  Saving _problems/test-sim_outbreak-68.R
  Saving _problems/test-sim_outbreak-86.R
  Saving _problems/test-truncate_linelist-2.R
  [ FAIL 31 | WARN 1 | SKIP 3 | PASS 139 ]
  
  ══ Skipped tests (3) ═══════════════════════════════════════════════════════════
  • On CRAN (3): 'test-sim_network_bp.R:4:1', 'test-sim_network_bp.R:17:1',
    'test-sim_network_bp.R:31:1'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-add_cols.R:187:3'): .add_names works as expected ───────────────
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist:::.add_names(.data = ll) at test-add_cols.R:187:3
   2.   └─simulist:::.sample_names(.data = .data)
   3.     ├─base::unique(...)
   4.     └─randomNames::randomNames(...)
   5.       ├─...[]
   6.       └─data.table:::`[.data.table`(...)
  ── Error ('test-add_cols.R:200:3'): .add_names works as expected with anonymise = TRUE ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist:::.add_names(.data = ll, anonymise = TRUE) at test-add_cols.R:200:3
   2.   └─simulist:::.sample_names(.data = .data)
   3.     ├─base::unique(...)
   4.     └─randomNames::randomNames(...)
   5.       ├─...[]
   6.       └─data.table:::`[.data.table`(...)
  ── Error ('test-censor_linelist.R:2:1'): (code run outside of `test_that()`) ───
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_linelist() at test-censor_linelist.R:2:1
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-messy_linelist.R:3:1'): (code run outside of `test_that()`) ────
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_linelist() at test-messy_linelist.R:3:1
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_contacts.R:3:3'): sim_contacts works as expected with defaults ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_contacts()
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_contacts.R:11:3'): sim_contacts works as expected ──────────
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_contacts(...)
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_contacts.R:22:3'): sim_contacts works as expected with modified config ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_contacts(...)
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_contacts.R:36:3'): sim_contacts works as expected with modified config parameters ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_contacts(...)
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_contacts.R:80:3'): sim_contacts works as expected with age structure ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_contacts(...)
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_linelist.R:3:3'): sim_linelist works as expected with defaults ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_linelist()
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_linelist.R:17:3'): sim_linelist works as expected ──────────
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_linelist(...)
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_linelist.R:42:3'): sim_linelist works as expected with age-strat risks ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_linelist(...)
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_linelist.R:58:3'): sim_linelist works as expected with anonymous ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_linelist(...)
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_linelist.R:76:3'): sim_linelist works as expected with age structure ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_linelist(...)
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_linelist.R:98:3'): sim_linelist works as expected with age-strat risks & age struct ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_linelist(...)
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_linelist.R:117:3'): sim_linelist gives expected proportion of ages with age struct ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_linelist(...) at test-sim_linelist.R:117:3
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_linelist.R:148:3'): sim_linelist works as expected with modified config ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_linelist(...)
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_linelist.R:164:3'): sim_linelist works as expected with modified config parameters ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_linelist(...)
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_linelist.R:180:3'): sim_linelist warns as expected ─────────
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test-sim_linelist.R:180:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─simulist::sim_linelist(...)
    8.   └─simulist:::.sim_internal(...)
    9.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   10.       └─simulist:::.sample_names(.data = .data)
   11.         ├─base::unique(...)
   12.         └─randomNames::randomNames(...)
   13.           ├─...[]
   14.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_linelist.R:239:3'): sim_linelist warns when risks are given by onset-to-event is NULL ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test-sim_linelist.R:239:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─simulist::sim_linelist(...)
    8.   └─simulist:::.sim_internal(...)
    9.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   10.       └─simulist:::.sample_names(.data = .data)
   11.         ├─base::unique(...)
   12.         └─randomNames::randomNames(...)
   13.           ├─...[]
   14.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_linelist.R:278:3'): sim_linelist is silent when onset is NULL and risk is off ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_silent(...) at test-sim_linelist.R:278:3
    2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ ├─withr::with_output_sink(...)
    5. │   │ │ └─base::force(code)
    6. │   │ ├─base::withCallingHandlers(...)
    7. │   │ └─base::withVisible(code)
    8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    9. └─simulist::sim_linelist(...)
   10.   └─simulist:::.sim_internal(...)
   11.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   12.       └─simulist:::.sample_names(.data = .data)
   13.         ├─base::unique(...)
   14.         └─randomNames::randomNames(...)
   15.           ├─...[]
   16.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_linelist.R:357:3'): sim_linest date_admission column is NA when onset_to_hosp is NULL ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─base::suppressWarnings(...) at test-sim_linelist.R:357:3
    2. │ └─base::withCallingHandlers(...)
    3. └─simulist::sim_linelist(...)
    4.   └─simulist:::.sim_internal(...)
    5.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
    6.       └─simulist:::.sample_names(.data = .data)
    7.         ├─base::unique(...)
    8.         └─randomNames::randomNames(...)
    9.           ├─...[]
   10.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_linelist.R:383:3'): sim_linest date_death column is NA when onset_to_death is NULL ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─base::suppressWarnings(...) at test-sim_linelist.R:383:3
    2. │ └─base::withCallingHandlers(...)
    3. └─simulist::sim_linelist(...)
    4.   └─simulist:::.sim_internal(...)
    5.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
    6.       └─simulist:::.sample_names(.data = .data)
    7.         ├─base::unique(...)
    8.         └─randomNames::randomNames(...)
    9.           ├─...[]
   10.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_linelist.R:408:3'): sim_linelist works as expected with time-varying cfr ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_linelist(...)
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_linelist.R:428:3'): sim_linelist works as expected with time-varying cfr & age-strat ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_linelist(...)
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_outbreak.R:3:3'): sim_outbreak works as expected with defaults ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_outbreak()
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_outbreak.R:18:3'): sim_outbreak works as expected ──────────
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_outbreak(...)
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_outbreak.R:31:3'): sim_outbreak works as expected with anonymised ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_outbreak(...)
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_outbreak.R:57:3'): sim_outbreak works as expected with age-strat risks ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_outbreak(...)
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-sim_outbreak.R:77:3'): sim_outbreak works as expected with age structure ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_outbreak(...)
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  ── Error ('test-truncate_linelist.R:2:1'): (code run outside of `test_that()`) ──
  Error in ``[.data.table`(tmp.dt, , `:=`(first_name, first_names(gender, ethnicity, .N)), by = list(gender, ethnicity))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulist::sim_linelist() at test-truncate_linelist.R:2:1
   2.   └─simulist:::.sim_internal(...)
   3.     └─simulist:::.add_names(.data = .data, anonymise = anonymise)
   4.       └─simulist:::.sample_names(.data = .data)
   5.         ├─base::unique(...)
   6.         └─randomNames::randomNames(...)
   7.           ├─...[]
   8.           └─data.table:::`[.data.table`(...)
  
  [ FAIL 31 | WARN 1 | SKIP 3 | PASS 139 ]
  Error:
  ! Test failures.
  Execution halted