Running ‘testthat.R’ [31s/46s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(popEpi)
  > test_check("popEpi")
  ── 1. Error: aggre leaves original data untouched (@test_aggre.R#7)  ───────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: lexpand(x, birth = bi_date, entry = dg_date, exit = ex_date, status = status %in% 
         1:2, breaks = BL) at testthat/test_aggre.R:7
  2: splitMulti(l, breaks = breaks, drop = drop, verbose = FALSE, merge = TRUE)
  3: l[, `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id"]
  4: `[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, 
         by = "lex.id")
  
  ── 2. Error: aggre works with by = NULL (@test_aggre.R#30)  ────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: lexpand(sr, birth = bi_date, entry = dg_date, exit = ex_date, status = status %in% 
         1:2, breaks = BL) at testthat/test_aggre.R:30
  2: splitMulti(l, breaks = breaks, drop = drop, verbose = FALSE, merge = TRUE)
  3: l[, `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id"]
  4: `[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, 
         by = "lex.id")
  
  ── 3. Error: aggre and lexpand produce the same results (@test_aggre.R#42)  ────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: lexpand(sr, birth = bi_date, entry = dg_date, exit = ex_date, status = status %in% 
         1:2, breaks = BL) at testthat/test_aggre.R:42
  2: splitMulti(l, breaks = breaks, drop = drop, verbose = FALSE, merge = TRUE)
  3: l[, `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id"]
  4: `[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, 
         by = "lex.id")
  
  ── 4. Error: aggre()'s by argument works flexibly (@test_aggre.R#103)  ─────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: splitMulti(x, breaks = BL) at testthat/test_aggre.R:103
  2: l[, `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id"]
  3: `[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, 
         by = "lex.id")
  
  ── 5. Error: subset argument works properly (@test_aggre.R#137)  ───────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: lexpand(x, birth = bi_date, entry = dg_date, exit = ex_date, status = status %in% 
         1:2, breaks = BL) at testthat/test_aggre.R:137
  2: splitMulti(l, breaks = breaks, drop = drop, verbose = FALSE, merge = TRUE)
  3: l[, `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id"]
  4: `[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, 
         by = "lex.id")
  
  NOTE: entry.status has been set to 0 for all.
  ── 6. Error: pp not added to data if pp = FALSE but pop.haz is (@test_lexpand.R#
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: lexpand(sire[dg_date < ex_date, ][0:100], birth = bi_date, entry = dg_date, exit = ex_date, 
         status = status %in% 1:2, breaks = list(fot = 0:5), pophaz = data.table(popEpi::popmort), 
         pp = FALSE) at testthat/test_lexpand.R:46
  2: l[, `:=`(lex.multi, 1:.N), by = lex.id]
  3: `[.data.table`(l, , `:=`(lex.multi, 1:.N), by = lex.id)
  
  ── 7. Error: lexpanding and aggregating to years works (@test_lexpand.R#185)  ──
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: lexpand(sire[dg_date < ex_date, ], breaks = list(per = 2000:2014), status = status, 
         birth = bi_date, entry = dg_date, exit = ex_date) at testthat/test_lexpand.R:185
  2: l[, `:=`(lex.multi, 1:.N), by = lex.id]
  3: `[.data.table`(l, , `:=`(lex.multi, 1:.N), by = lex.id)
  
  ── 8. Error: lexpand aggre: multistate column names correct (@test_lexpand.R#235
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: lexpand(sire[dg_date < ex_date, ][0:100], birth = bi_date, entry = dg_date, exit = ex_date, 
         breaks = list(fot = c(0, 5, 10, 50, Inf), age = c(seq(0, 85, 5), Inf), per = 1993:2013), 
         status = status, aggre = list(fot, age, per)) at testthat/test_lexpand.R:235
  2: splitMulti(l, breaks = breaks, drop = drop, verbose = FALSE, merge = TRUE)
  3: l[, `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id"]
  4: `[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, 
         by = "lex.id")
  
  ── 9. Error: different specifications of time vars work with event defined and o
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: lexpand(data = dt, subset = NULL, birth = bi_date, entry = start, exit = end, event = dg_date, 
         id = id, overlapping = FALSE, entry.status = 0, status = status, merge = FALSE) at testthat/test_lexpand.R:286
  2: l[, `:=`((tmpLX), shift(lex.Xst, n = 1, type = "lag")), by = lex.id]
  3: `[.Lexis`(l, , `:=`((tmpLX), shift(lex.Xst, n = 1, type = "lag")), by = lex.id)
  4: NextMethod(x)
  5: `[.data.table`(l, , `:=`((tmpLX), shift(lex.Xst, n = 1, type = "lag")), by = lex.id)
  
  ── 10. Error: rate works with different weights (@test_rate.R#27)  ─────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: rate(data = p18, obs = "OBS", pyrs = "PYRS", print = "COV", adjust = "AGEGROUP", 
         weights = c(1:18)) at testthat/test_rate.R:27
  2: makeWeightsDT(data, values = list(tmpObsNames, tmpPyrNames), print = tmpPrNames, 
         adjust = tmpAdNames, weights = weights, internal.weights.values = tmpPyrNames, 
         NA.text = NA.msg)
  3: weights[, `:=`(weights, weights/sum(weights)), by = eval(byCols)]
  4: `[.data.table`(weights, , `:=`(weights, weights/sum(weights)), by = eval(byCols))
  
  ── 11. Error: makeWeightsDT works in rate (@test_rate.R#81)  ───────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: makeWeightsDT(p18, adjust = substitute(factor(AGEGROUP, 1:18, 1:18)), weights = wv, 
         print = NULL, values = list(op)) at testthat/test_rate.R:81
  2: data[cj, lapply(.SD, sum), .SDcols = c(vaVars, iwVar), by = .EACHI]
  3: `[.data.table`(data, cj, lapply(.SD, sum), .SDcols = c(vaVars, iwVar), by = .EACHI)
  
  ── 12. Error: names dont cause problems (@test_rate.R#94)  ─────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: rate(data = p18b, obs = "obs", pyrs = "pyrs", print = "COV", adjust = "agegroup", 
         weights = "nordic") at testthat/test_rate.R:94
  2: makeWeightsDT(data, values = list(tmpObsNames, tmpPyrNames), print = tmpPrNames, 
         adjust = tmpAdNames, weights = weights, internal.weights.values = tmpPyrNames, 
         NA.text = NA.msg)
  3: weights[, `:=`(weights, weights/sum(weights)), by = eval(byCols)]
  4: `[.data.table`(weights, , `:=`(weights, weights/sum(weights)), by = eval(byCols))
  
  ── 13. Error: rate works with different weights an subset (@test_rate.R#113)  ──
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: rate(data = p18, obs = "OBS", pyrs = "PYRS", print = NULL, adjust = "AGEGROUP", weights = c(1:18)) at testthat/test_rate.R:113
  2: makeWeightsDT(data, values = list(tmpObsNames, tmpPyrNames), print = tmpPrNames, 
         adjust = tmpAdNames, weights = weights, internal.weights.values = tmpPyrNames, 
         NA.text = NA.msg)
  3: data[cj, lapply(.SD, sum), .SDcols = c(vaVars, iwVar), by = .EACHI]
  4: `[.data.table`(data, cj, lapply(.SD, sum), .SDcols = c(vaVars, iwVar), by = .EACHI)
  
  ── 14. Error: rate works with different weights and syntaxies (@test_rate.R#135)
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: rate(data = p18, obs = "OBS", pyrs = "PYRS", print = NULL, adjust = NULL) at testthat/test_rate.R:135
  2: makeWeightsDT(data, values = list(tmpObsNames, tmpPyrNames), print = tmpPrNames, 
         adjust = tmpAdNames, weights = weights, internal.weights.values = tmpPyrNames, 
         NA.text = NA.msg)
  3: data[cj, lapply(.SD, sum), .SDcols = c(vaVars, iwVar), by = .EACHI]
  4: `[.data.table`(data, cj, lapply(.SD, sum), .SDcols = c(vaVars, iwVar), by = .EACHI)
  
  ── 15. Error: in rate levels of adjust are printable (@test_rate.R#205)  ───────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: rate(data = p18, obs = "OBS", pyrs = "PYRS", print = list(COV, AG = findInterval(AGEGROUP, 
         c(0, 8, 20))), adjust = "AGEGROUP", weights = "cohort") at testthat/test_rate.R:205
  2: makeWeightsDT(data, values = list(tmpObsNames, tmpPyrNames), print = tmpPrNames, 
         adjust = tmpAdNames, weights = weights, internal.weights.values = tmpPyrNames, 
         NA.text = NA.msg)
  3: lapply(seq_along(adjust), function(i) {
         cn <- names(adjust)[i]
         le <- unique(adjust[[i]])
         le <- structure(list(le), names = cn)
         data[le, lapply(.SD, sum), .SDcols = iwVar, by = .EACHI, on = cn][[iwVar]]
     })
  4: FUN(X[[i]], ...)
  5: data[le, lapply(.SD, sum), .SDcols = iwVar, by = .EACHI, on = cn]
  6: `[.data.table`(data, le, lapply(.SD, sum), .SDcols = iwVar, by = .EACHI, on = cn)
  
  ── 16. Error: rate.plot doesnt throw an error (@test_rate.R#211)  ──────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: rate(data = p18, obs = "OBS", pyrs = "PYRS", print = list(COV, AG = findInterval(AGEGROUP, 
         c(0, 8, 20))), adjust = "AGEGROUP", weights = "cohort") at testthat/test_rate.R:211
  2: makeWeightsDT(data, values = list(tmpObsNames, tmpPyrNames), print = tmpPrNames, 
         adjust = tmpAdNames, weights = weights, internal.weights.values = tmpPyrNames, 
         NA.text = NA.msg)
  3: lapply(seq_along(adjust), function(i) {
         cn <- names(adjust)[i]
         le <- unique(adjust[[i]])
         le <- structure(list(le), names = cn)
         data[le, lapply(.SD, sum), .SDcols = iwVar, by = .EACHI, on = cn][[iwVar]]
     })
  4: FUN(X[[i]], ...)
  5: data[le, lapply(.SD, sum), .SDcols = iwVar, by = .EACHI, on = cn]
  6: `[.data.table`(data, le, lapply(.SD, sum), .SDcols = iwVar, by = .EACHI, on = cn)
  
  ── 17. Error: rate works with missing values (@test_rate.R#223)  ───────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: expect_warning(rate(data = p18c, obs = "OBS", pyrs = "PYRS", adjust = "AGEGROUP", 
         weights = 1:18), "Data contains 2 NA values.") at testthat/test_rate.R:223
  2: quasi_capture(enquo(object), capture_warnings, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withCallingHandlers(code, warning = function(condition) {
         out$push(condition)
         invokeRestart("muffleWarning")
     })
  5: eval_bare(get_expr(quo), get_env(quo))
  6: rate(data = p18c, obs = "OBS", pyrs = "PYRS", adjust = "AGEGROUP", weights = 1:18)
  7: makeWeightsDT(data, values = list(tmpObsNames, tmpPyrNames), print = tmpPrNames, 
         adjust = tmpAdNames, weights = weights, internal.weights.values = tmpPyrNames, 
         NA.text = NA.msg)
  8: data[cj, lapply(.SD, sum), .SDcols = c(vaVars, iwVar), by = .EACHI]
  9: `[.data.table`(data, cj, lapply(.SD, sum), .SDcols = c(vaVars, iwVar), by = .EACHI)
  
  ── 18. Error: rate standard error and CIS works (@test_rate.R#227)  ────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: rate(data = p18, obs = "OBS", pyrs = "PYRS", adjust = "AGEGROUP", weights = 1:18) at testthat/test_rate.R:227
  2: makeWeightsDT(data, values = list(tmpObsNames, tmpPyrNames), print = tmpPrNames, 
         adjust = tmpAdNames, weights = weights, internal.weights.values = tmpPyrNames, 
         NA.text = NA.msg)
  3: data[cj, lapply(.SD, sum), .SDcols = c(vaVars, iwVar), by = .EACHI]
  4: `[.data.table`(data, cj, lapply(.SD, sum), .SDcols = c(vaVars, iwVar), by = .EACHI)
  
  ── 19. Error: rate_ratio works (@test_rate.R#243)  ─────────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: rate(data = p18, obs = "OBS", pyrs = "PYRS", print = "COV", adjust = "AGEGROUP", 
         weights = c(1:18)) at testthat/test_rate.R:243
  2: makeWeightsDT(data, values = list(tmpObsNames, tmpPyrNames), print = tmpPrNames, 
         adjust = tmpAdNames, weights = weights, internal.weights.values = tmpPyrNames, 
         NA.text = NA.msg)
  3: weights[, `:=`(weights, weights/sum(weights)), by = eval(byCols)]
  4: `[.data.table`(weights, , `:=`(weights, weights/sum(weights)), by = eval(byCols))
  
  ── 20. Error: SIR w/ coh=ref=popEpi::sire (@test_sir.R#11)  ────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: ltable(sire2[status != 0], c("ex_y", "agegroup"), expr = list(obs = .N, pyrs = sum(dur))) at testthat/test_sir.R:11
  2: expr.by.cj(data = data, by.vars = by.vars, expr = e, subset = subset, use.levels = use.levels, 
         na.rm = na.rm, robust = robust)
  3: eval(parse(text = tabe))
  4: eval(parse(text = tabe))
  5: tab[subset][cj, eval(e), on = by.vars, by = .EACHI, ...]
  6: `[.data.table`(tab[subset], cj, eval(e), on = by.vars, by = .EACHI, ...)
  
  ── 21. Error: (unknown) (@test_sir.R#56)  ──────────────────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: lexpand(popEpi::sire[dg_date < ex_date, ], status = status, birth = bi_date, exit = ex_date, 
         entry = dg_date, breaks = list(per = 1990:2013, age = 0:100, fot = c(0, 10, 20, 
             Inf)), aggre = list(fot, agegroup = age, year = per, sex)) at testthat/test_sir.R:56
  2: splitMulti(l, breaks = breaks, drop = drop, verbose = FALSE, merge = TRUE)
  3: l[, `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id"]
  4: `[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, 
         by = "lex.id")
  
  ── 22. Error: splitMulti agrees with splitLexis, vol. II (@test_splitMulti.R#120
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: splitMulti(lex, breaks = BL, drop = FALSE) at testthat/test_splitMulti.R:120
  2: l[, `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id"]
  3: `[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, 
         by = "lex.id")
  
  ── 23. Error: popEpi splitters produce correct attributes (@test_splitting_attri
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: splitMulti(sire, breaks = BL, drop = TRUE) at testthat/test_splitting_attributes.R:29
  2: l[, `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id"]
  3: `[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, 
         by = "lex.id")
  
  NOTE: entry.status has been set to "DM" for all.
  ── 24. Error: removing consecutively bad surv.ints is logical w/ & w/out adjusti
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: lexpand(sire2, birth = bi_date, entry = dg_date, exit = ex_date, status = status %in% 
         1:2, breaks = BL) at testthat/test_survtab_bad_surv_ints.R:10
  2: splitMulti(l, breaks = breaks, drop = drop, verbose = FALSE, merge = TRUE)
  3: l[, `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id"]
  4: `[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, 
         by = "lex.id")
  
  ── 25. Error: survtab_ag messages & results due to non-consecutively bad surv.in
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: lexpand(sire2, birth = bi_date, entry = dg_date, exit = ex_date, status = status %in% 
         1:2, breaks = BL) at testthat/test_survtab_bad_surv_ints.R:47
  2: splitMulti(l, breaks = breaks, drop = drop, verbose = FALSE, merge = TRUE)
  3: l[, `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id"]
  4: `[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, 
         by = "lex.id")
  
  ── 26. Error: surv.obs about the same as Kaplan-Meier & CIFs close to Aalen-Joha
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: lexpand(sire2, birth = bi_date, entry = dg_date, exit = ex_date, status = statusf, 
         breaks = BL) at testthat/test_survtab_observed.R:10
  2: splitMulti(l, breaks = breaks, drop = drop, verbose = FALSE, merge = TRUE)
  3: l[, `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id"]
  4: `[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, 
         by = "lex.id")
  
  ── 27. Error: survtab works with more complicated estimation (@test_survtab_obse
  as.data.table.array method should be only called for arrays with 3+ dimensions, for 2 dimensions matrix method should be used
  1: survtab(Surv(time = FUT, event = lex.Xst) ~ factor(sex, 0:1, c("male", "female")) + 
         period + adjust(agegr), data = xl, weights = list(agegr = as.numeric(table(x$agegr))), 
         surv.type = "surv.obs", breaks = list(FUT = seq(0, 5, 1/12))) at testthat/test_survtab_observed.R:112
  2: usePopFormula(form = formula, adjust = adjust, data = x, enclos = PF, Surv.response = "either")
  3: evalPopFormula(formula = al$arg, data = data, enclos = enclos, Surv.response = Surv.response)
  4: Surv2DT(y)
  5: data.table(dt)
  6: as.data.table(xi, keep.rownames = keep.rownames)
  7: as.data.table.array(xi, keep.rownames = keep.rownames)
  8: stop("as.data.table.array method should be only called for arrays with 3+ dimensions, for 2 dimensions matrix method should be used")
  
  ── 28. Error: relative survivals about the same as relsurv's (@test_survtab_rela
  as.data.table.array method should be only called for arrays with 3+ dimensions, for 2 dimensions matrix method should be used
  1: survtab(Surv(fot, event = lex.Xst) ~ 1, data = x, surv.type = "surv.rel", relsurv.method = "e2", 
         pophaz = pm, breaks = list(fot = fb)) at testthat/test_survtab_relative.R:57
  2: usePopFormula(form = formula, adjust = adjust, data = x, enclos = PF, Surv.response = "either")
  3: evalPopFormula(formula = al$arg, data = data, enclos = enclos, Surv.response = Surv.response)
  4: Surv2DT(y)
  5: data.table(dt)
  6: as.data.table(xi, keep.rownames = keep.rownames)
  7: as.data.table.array(xi, keep.rownames = keep.rownames)
  8: stop("as.data.table.array method should be only called for arrays with 3+ dimensions, for 2 dimensions matrix method should be used")
  
  ── 29. Error: Ederer I expected survival curve agrees with survival::survexp (@t
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: comp_e1(x, breaks = list(fot = fb), pophaz = pm, survScale = "fot") at testthat/test_survtab_relative.R:178
  2: y[, `:=`(surv.exp, cumsum(haz)), by = eval(tmpID)]
  3: `[.data.table`(y, , `:=`(surv.exp, cumsum(haz)), by = eval(tmpID))
  
  ── 30. Error: getCall & formula methods for survtab work (@test_survtab_usage.R#
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: lexpand(sire[sample(1:.N, 100)], birth = bi_date, entry = dg_date, exit = ex_date, 
         status = status %in% 1:2, breaks = BL, pophaz = popmort, aggre = list(sex, fot)) at testthat/test_survtab_usage.R:259
  2: splitMulti(l, breaks = breaks, drop = drop, verbose = FALSE, merge = TRUE)
  3: l[, `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id"]
  4: `[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, 
         by = "lex.id")
  
  ── 31. Error: survtab_ag allows for certain arguments to be length > 1 (@test_su
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: lexpand(sire, birth = bi_date, entry = dg_date, exit = ex_date, status = status, 
         breaks = BL, pophaz = popmort, aggre = list(fot)) at testthat/test_survtab_usage.R:284
  2: l[, `:=`(lex.multi, 1:.N), by = lex.id]
  3: `[.data.table`(l, , `:=`(lex.multi, 1:.N), by = lex.id)
  
  ── 32. Error: update() works with survtab objects (@test_survtab_usage.R#325)  ─
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: lexpand(sire, birth = bi_date, entry = dg_date, exit = ex_date, status = status %in% 
         1:2, breaks = BL, pophaz = popmort, aggre = list(sex, fot)) at testthat/test_survtab_usage.R:325
  2: splitMulti(l, breaks = breaks, drop = drop, verbose = FALSE, merge = TRUE)
  3: l[, `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id"]
  4: `[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, 
         by = "lex.id")
  
  ── 33. Error: internal weights work as intended (@test_survtab_usage.R#373)  ───
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: lexpand(sire, birth = bi_date, entry = dg_date, exit = ex_date, status = status %in% 
         1:2, breaks = BL, pophaz = popmort, aggre = list(fot, agegr)) at testthat/test_survtab_usage.R:373
  2: splitMulti(l, breaks = breaks, drop = drop, verbose = FALSE, merge = TRUE)
  3: l[, `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id"]
  4: `[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, 
         by = "lex.id")
  
  ── 34. Error: survtab_ag works with bare data.frames (@test_survtab_usage.R#401)
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: lexpand(sire, birth = bi_date, entry = dg_date, exit = ex_date, status = status %in% 
         1:2, breaks = BL, aggre = list(fot)) at testthat/test_survtab_usage.R:401
  2: splitMulti(l, breaks = breaks, drop = drop, verbose = FALSE, merge = TRUE)
  3: l[, `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id"]
  4: `[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, 
         by = "lex.id")
  
  ── 35. Error: evalPopArg produces intended results (@test_utils.R#120)  ────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: tf(arg = nv) at testthat/test_utils.R:120
  2: x[, list(sum = sum(a)), by = byTab] at testthat/test_utils.R:52
  3: `[.data.table`(x, , list(sum = sum(a)), by = byTab) at testthat/test_utils.R:52
  
  ── 36. Error: comp_pp_weighted_figures produces intended results (@test_utils.R#
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: lexpand(x, birth = bi_date, entry = dg_date, exit = ex_date, status = status %in% 
         1:2, pophaz = data.table(popEpi::popmort), breaks = list(fot = seq(0, 20, 1/12), 
         per = 1993:2013, age = 0:200)) at testthat/test_utils.R:204
  2: splitMulti(l, breaks = breaks, drop = drop, verbose = FALSE, merge = TRUE)
  3: l[, `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, by = "lex.id"]
  4: `[.data.table`(l, , `:=`((tmp_ie), shift(.SD, n = 1, type = "lead")), .SDcols = s1, 
         by = "lex.id")
  
  ── 37. Error: evalPopFormula & usePopFormula output is stable (@test_utils.R#251
  as.data.table.array method should be only called for arrays with 3+ dimensions, for 2 dimensions matrix method should be used
  1: evalPopFormula(f1a, data = x, enclos = TF, Surv.response = TRUE) at testthat/test_utils.R:251
  2: Surv2DT(y)
  3: data.table(dt)
  4: as.data.table(xi, keep.rownames = keep.rownames)
  5: as.data.table.array(xi, keep.rownames = keep.rownames)
  6: stop("as.data.table.array method should be only called for arrays with 3+ dimensions, for 2 dimensions matrix method should be used")
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 32 SKIPPED: 39 FAILED: 37
  1. Error: aggre leaves original data untouched (@test_aggre.R#7) 
  2. Error: aggre works with by = NULL (@test_aggre.R#30) 
  3. Error: aggre and lexpand produce the same results (@test_aggre.R#42) 
  4. Error: aggre()'s by argument works flexibly (@test_aggre.R#103) 
  5. Error: subset argument works properly (@test_aggre.R#137) 
  6. Error: pp not added to data if pp = FALSE but pop.haz is (@test_lexpand.R#46) 
  7. Error: lexpanding and aggregating to years works (@test_lexpand.R#185) 
  8. Error: lexpand aggre: multistate column names correct (@test_lexpand.R#235) 
  9. Error: different specifications of time vars work with event defined and overlapping=FALSE (@test_lexpand.R#286) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted