Running ‘testthat.R’ [23s/27s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > 
  > if (requireNamespace("testthat")) {
  +   library("testthat")
  +   library("popEpi")
  +   library("data.table")
  + 
  +   using_r_devel <- grepl(pattern = "devel", x = R.version$status)
  +   if (using_r_devel) {
  +     ## memory leak problem in data.table 1.11.2 in R-devel (3.6.0 atm)
  +     requireNamespace("data.table")
  +     data.table::setDTthreads(threads = 1L)
  +   }
  + 
  +   testthat::test_check("popEpi")
  + }
  Loading required namespace: testthat
  
  Attaching package: 'data.table'
  
  The following object is masked from 'package:base':
  
      %notin%
  
  Saving _problems/test_aggre-8.R
  Saving _problems/test_aggre-31.R
  Saving _problems/test_aggre-43.R
  Saving _problems/test_aggre-103.R
  Saving _problems/test_aggre-138.R
  Saving _problems/test_lexpand-51.R
  Saving _problems/test_lexpand-187.R
  Saving _problems/test_lexpand-239.R
  Saving _problems/test_lexpand-289.R
  Saving _problems/test_rate-16.R
  Saving _problems/test_rate-83.R
  Saving _problems/test_rate-104.R
  Saving _problems/test_rate-167.R
  Saving _problems/test_rate-194.R
  Saving _problems/test_rate-200.R
  Saving _problems/test_rate-232.R
  Saving _problems/test_sir-58.R
  Saving _problems/test_splitMulti-124.R
  Saving _problems/test_splitting_attributes-29.R
  NOTE: entry.status has been set to "DM" for all.
  Saving _problems/test_survtab_bad_surv_ints-11.R
  Saving _problems/test_survtab_bad_surv_ints-49.R
  Saving _problems/test_survtab_observed-13.R
  Saving _problems/test_survtab_observed-142.R
  Saving _problems/test_survtab_relative-61.R
  Saving _problems/test_survtab_relative-178.R
  Saving _problems/test_survtab_usage-261.R
  Saving _problems/test_survtab_usage-286.R
  Saving _problems/test_survtab_usage-334.R
  Saving _problems/test_survtab_usage-381.R
  Saving _problems/test_survtab_usage-408.R
  Saving _problems/test_utils-206.R
  Saving _problems/test_utils-229.R
  [ FAIL 32 | WARN 0 | SKIP 39 | PASS 71 ]
  
  ══ Skipped tests (39) ══════════════════════════════════════════════════════════
  • Unit tests skipped normally (39): 'test_aggre.R:162:3', 'test_aggre.R:199:3',
    'test_expo.R:4:3', 'test_lexpand.R:5:3', 'test_lexpand.R:29:3',
    'test_lexpand.R:59:3', 'test_lexpand.R:78:3', 'test_lexpand.R:99:3',
    'test_lexpand.R:137:3', 'test_lexpand.R:213:3', 'test_lexpand.R:249:3',
    'test_lexpand.R:342:3', 'test_relpois_mean_curve.R:4:3',
    'test_splitLexisDT.R:4:3', 'test_splitMulti.R:9:3',
    'test_splitting_breaks.R:5:3', 'test_splitting_breaks.R:39:3',
    'test_splitting_randomly_on_fixed_data.R:9:3',
    'test_splitting_randomly_on_random_data.R:9:3', 'test_survmean.R:6:3',
    'test_survmean.R:76:3', 'test_survmean.R:117:3', 'test_survmean.R:166:3',
    'test_survmean.R:265:3', 'test_survtab_adjusted.R:4:3',
    'test_survtab_observed.R:67:3', 'test_survtab_relative.R:81:5',
    'test_survtab_usage.R:6:3', 'test_survtab_usage.R:121:3',
    'test_survtab_usage.R:198:3', 'test_survtab_usage.R:432:3',
    'test_utils.R:4:3', 'test_utils.R:27:3', 'test_utils.R:138:3',
    'test_utils.R:179:3', 'test_weighter.R:5:3', 'test_weighter.R:47:3',
    'test_weighter.R:99:3', 'test_weighter.R:122:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test_aggre.R:7:3'): aggre leaves original data untouched ────────────
  Error in ``[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id")`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_aggre.R:7:3
   2.   └─popEpi::splitMulti(...)
   3.     ├─...[]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test_aggre.R:30:3'): aggre works with by = NULL ─────────────────────
  Error in ``[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id")`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_aggre.R:30:3
   2.   └─popEpi::splitMulti(...)
   3.     ├─...[]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test_aggre.R:42:3'): aggre and lexpand produce the same results ─────
  Error in ``[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id")`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_aggre.R:42:3
   2.   └─popEpi::splitMulti(...)
   3.     ├─...[]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test_aggre.R:103:5'): aggre()'s by argument works flexibly ──────────
  Error in ``[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id")`: attempt access index 13/13 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::splitMulti(x, breaks = BL) at test_aggre.R:103:5
   2.   ├─...[]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test_aggre.R:137:3'): subset argument works properly ────────────────
  Error in ``[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id")`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_aggre.R:137:3
   2.   └─popEpi::splitMulti(...)
   3.     ├─...[]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test_lexpand.R:46:3'): pp not added to data if pp = FALSE but pop.haz is ──
  Error in ``[.data.table`(l, , `:=`(lex.multi, 1:.N), by = lex.id)`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_lexpand.R:46:3
   2.   ├─l[, `:=`(lex.multi, 1:.N), by = lex.id]
   3.   └─data.table:::`[.data.table`(l, , `:=`(lex.multi, 1:.N), by = lex.id)
  ── Error ('test_lexpand.R:185:3'): lexpanding and aggregating to years works ───
  Error in ``[.data.table`(l, , `:=`(lex.multi, 1:.N), by = lex.id)`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_lexpand.R:185:3
   2.   ├─l[, `:=`(lex.multi, 1:.N), by = lex.id]
   3.   └─data.table:::`[.data.table`(l, , `:=`(lex.multi, 1:.N), by = lex.id)
  ── Error ('test_lexpand.R:235:3'): lexpand aggre: multistate column names correct ──
  Error in ``[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id")`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_lexpand.R:235:3
   2.   └─popEpi::splitMulti(...)
   3.     ├─...[]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test_lexpand.R:286:3'): different specifications of time vars work with event defined and overlapping=FALSE ──
  Error in ``[.data.table`(l, , `:=`(lex.multi, 1:.N), by = lex.id)`: attempt access index 7/7 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_lexpand.R:286:3
   2.   ├─l[, `:=`(lex.multi, 1:.N), by = lex.id]
   3.   └─data.table:::`[.data.table`(l, , `:=`(lex.multi, 1:.N), by = lex.id)
  ── Error ('test_rate.R:16:3'): rate works with different weights ───────────────
  Error in ``[.data.table`(data, , eval(k), by = print)`: attempt access index 7/7 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::rate(...) at test_rate.R:16:3
   2.   └─popEpi:::rate_est(...)
   3.     ├─data[, eval(k), by = print]
   4.     └─data.table:::`[.data.table`(data, , eval(k), by = print)
  ── Error ('test_rate.R:83:3'): names dont cause problems ───────────────────────
  Error in ``[.data.table`(data, , eval(k), by = print)`: attempt access index 7/7 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::rate(...) at test_rate.R:83:3
   2.   └─popEpi:::rate_est(...)
   3.     ├─data[, eval(k), by = print]
   4.     └─data.table:::`[.data.table`(data, , eval(k), by = print)
  ── Error ('test_rate.R:104:3'): rate works with different weights an subset ────
  Error in ``[.data.table`(data, , eval(k), by = print)`: attempt access index 7/7 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::rate(...) at test_rate.R:104:3
   2.   └─popEpi:::rate_est(...)
   3.     ├─data[, eval(k), by = print]
   4.     └─data.table:::`[.data.table`(data, , eval(k), by = print)
  ── Error ('test_rate.R:167:3'): rate works with different weights and syntaxies ──
  Error in ``[.data.table`(data, , eval(k), by = print)`: attempt access index 7/7 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::rate(...) at test_rate.R:167:3
   2.   └─popEpi:::rate_est(...)
   3.     ├─data[, eval(k), by = print]
   4.     └─data.table:::`[.data.table`(data, , eval(k), by = print)
  ── Error ('test_rate.R:194:3'): in rate levels of adjust are printable ─────────
  Error in ``[.data.table`(data, , eval(k), by = print)`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::rate(...) at test_rate.R:194:3
   2.   └─popEpi:::rate_est(...)
   3.     ├─data[, eval(k), by = print]
   4.     └─data.table:::`[.data.table`(data, , eval(k), by = print)
  ── Error ('test_rate.R:200:3'): rate.plot doesnt throw an error ────────────────
  Error in ``[.data.table`(data, , eval(k), by = print)`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::rate(...) at test_rate.R:200:3
   2.   └─popEpi:::rate_est(...)
   3.     ├─data[, eval(k), by = print]
   4.     └─data.table:::`[.data.table`(data, , eval(k), by = print)
  ── Error ('test_rate.R:232:3'): rate_ratio works ───────────────────────────────
  Error in ``[.data.table`(data, , eval(k), by = print)`: attempt access index 7/7 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::rate(...) at test_rate.R:232:3
   2.   └─popEpi:::rate_est(...)
   3.     ├─data[, eval(k), by = print]
   4.     └─data.table:::`[.data.table`(data, , eval(k), by = print)
  ── Error ('test_sir.R:56:1'): (code run outside of `test_that()`) ──────────────
  Error in ``[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id")`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_sir.R:56:1
   2.   └─popEpi::splitMulti(...)
   3.     ├─...[]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test_splitMulti.R:124:3'): splitMulti agrees with splitLexis, vol. II ──
  Error in ``[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id")`: attempt access index 13/13 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::splitMulti(lex, breaks = BL, drop = FALSE) at test_splitMulti.R:124:3
   2.   ├─...[]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test_splitting_attributes.R:29:3'): popEpi splitters produce correct attributes ──
  Error in ``[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id")`: attempt access index 17/17 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::splitMulti(sire, breaks = BL, drop = TRUE) at test_splitting_attributes.R:29:3
   2.   ├─...[]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test_survtab_bad_surv_ints.R:10:3'): removing consecutively bad surv.ints is logical w/ & w/out adjusting ──
  Error in ``[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id")`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_survtab_bad_surv_ints.R:10:3
   2.   └─popEpi::splitMulti(...)
   3.     ├─...[]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test_survtab_bad_surv_ints.R:47:3'): survtab_ag messages & results due to non-consecutively bad surv.ints are OK ──
  Error in ``[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id")`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_survtab_bad_surv_ints.R:47:3
   2.   └─popEpi::splitMulti(...)
   3.     ├─...[]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test_survtab_observed.R:10:3'): surv.obs about the same as Kaplan-Meier & CIFs close to Aalen-Johansen ──
  Error in ``[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id")`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_survtab_observed.R:10:3
   2.   └─popEpi::splitMulti(...)
   3.     ├─...[]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test_survtab_observed.R:138:3'): survtab works with more complicated estimation ──
  Error in ``[.data.table`(data, , `:=`("surv.int", 1:.N), by = eval(byVars))`: attempt access index 9/9 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::survtab(...) at test_survtab_observed.R:138:3
   2.   └─popEpi::survtab_ag(...)
   3.     ├─data[, `:=`("surv.int", 1:.N), by = eval(byVars)]
   4.     └─data.table:::`[.data.table`(data, , `:=`("surv.int", 1:.N), by = eval(byVars))
  ── Error ('test_survtab_relative.R:60:5'): relative survivals about the same as relsurv's ──
  Error in ``[.data.table`(lex, , `:=`(c(tmpPCS), list(exp(-cumsum(.SD[[1L]] * lex.dur)))), by = lex.id, .SDcols = c(haz, "lex.dur"))`: attempt access index 14/14 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::survtab(...) at test_survtab_relative.R:60:5
   2.   └─popEpi:::comp_pp_weights(...)
   3.     ├─...[]
   4.     ├─Epi::`[.Lexis`(...)
   5.     ├─base::NextMethod(x)
   6.     └─data.table:::`[.data.table`(...)
  ── Error ('test_survtab_relative.R:178:5'): Ederer I expected survival curve agrees with survival::survexp ──
  Error in ``[.data.table`(y, , `:=`(surv.exp, cumsum(haz)), by = eval(tmpID))`: attempt access index 3/3 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi:::comp_e1(x, breaks = list(fot = fb), pophaz = pm, survScale = "fot") at test_survtab_relative.R:178:5
   2.   ├─y[, `:=`(surv.exp, cumsum(haz)), by = eval(tmpID)]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test_survtab_usage.R:256:3'): getCall & formula methods for survtab work ──
  Error in ``[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id")`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_survtab_usage.R:256:3
   2.   └─popEpi::splitMulti(...)
   3.     ├─...[]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test_survtab_usage.R:281:3'): survtab_ag allows for certain arguments to be length > 1 ──
  Error in ``[.data.table`(l, , `:=`(lex.multi, 1:.N), by = lex.id)`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_survtab_usage.R:281:3
   2.   ├─l[, `:=`(lex.multi, 1:.N), by = lex.id]
   3.   └─data.table:::`[.data.table`(l, , `:=`(lex.multi, 1:.N), by = lex.id)
  ── Error ('test_survtab_usage.R:329:3'): update() works with survtab objects ───
  Error in ``[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id")`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_survtab_usage.R:329:3
   2.   └─popEpi::splitMulti(...)
   3.     ├─...[]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test_survtab_usage.R:377:3'): internal weights work as intended ─────
  Error in ``[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id")`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_survtab_usage.R:377:3
   2.   └─popEpi::splitMulti(...)
   3.     ├─...[]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test_survtab_usage.R:405:3'): survtab_ag works with bare data.frames ──
  Error in ``[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id")`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_survtab_usage.R:405:3
   2.   └─popEpi::splitMulti(...)
   3.     ├─...[]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test_utils.R:204:3'): comp_pp_weighted_figures produces intended results ──
  Error in ``[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id")`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_utils.R:204:3
   2.   └─popEpi::splitMulti(...)
   3.     ├─...[]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test_utils.R:228:3'): evalPopFormula & usePopFormula output is stable ──
  Error in ``[.data.table`(l, , `:=`(lex.multi, 1:.N), by = lex.id)`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─popEpi::lexpand(...) at test_utils.R:228:3
   2.   ├─l[, `:=`(lex.multi, 1:.N), by = lex.id]
   3.   └─data.table:::`[.data.table`(l, , `:=`(lex.multi, 1:.N), by = lex.id)
  
  [ FAIL 32 | WARN 0 | SKIP 39 | PASS 71 ]
  Error:
  ! Test failures.
  Execution halted