Running ‘testthat.R’ [136s/64s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(popEpi)
  > test_check("popEpi")
  NOTE: entry.status has been set to 0 for all.
  NOTE: entry.status has been set to "DM" for all.
  ── 1. Error: removing consecutively bad surv.ints is logical w/ & w/out adjustin
  as.data.table.array method should be only called for arrays with 3+ dimensions, for 2 dimensions matrix method should be used
  1: expect_message({
         st1 <- survtab(Surv(fot, lex.Xst) ~ agegr, subset = !(agegr == 1L & fot > 8.49), 
             data = x, surv.type = "surv.obs")
     }, regexp = NA) at testthat/test_survtab_bad_surv_ints.R:16
  2: quasi_capture(enquo(object), capture_messages, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withCallingHandlers(code, message = function(condition) {
         out$push(condition)
         invokeRestart("muffleMessage")
     })
  5: eval_bare(get_expr(quo), get_env(quo))
  6: survtab(Surv(fot, lex.Xst) ~ agegr, subset = !(agegr == 1L & fot > 8.49), data = x, 
         surv.type = "surv.obs") at testthat/test_survtab_bad_surv_ints.R:17
  7: usePopFormula(form = formula, adjust = adjust, data = x, enclos = PF, Surv.response = "either")
  8: evalPopFormula(formula = al$arg, data = data, enclos = enclos, Surv.response = Surv.response)
  9: Surv2DT(y)
  10: data.table(dt)
  11: as.data.table(xi, keep.rownames = keep.rownames)
  12: as.data.table.array(xi, keep.rownames = keep.rownames)
  13: stop("as.data.table.array method should be only called for arrays with 3+ dimensions, for 2 dimensions matrix method should be used")
  
  ── 2. Error: survtab_ag messages & results due to non-consecutively bad surv.int
  as.data.table.array method should be only called for arrays with 3+ dimensions, for 2 dimensions matrix method should be used
  1: expect_message(eval(tf1), msgs[1], ignore.case = TRUE) at testthat/test_survtab_bad_surv_ints.R:69
  2: quasi_capture(enquo(object), capture_messages, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withCallingHandlers(code, message = function(condition) {
         out$push(condition)
         invokeRestart("muffleMessage")
     })
  5: eval_bare(get_expr(quo), get_env(quo))
  6: eval(tf1)
  7: eval(tf1)
  8: survtab(Surv(fot, lex.Xst) ~ 1, data = x, surv.type = "surv.obs", subset = !(fot >= 
         5 & fot < 7))
  9: usePopFormula(form = formula, adjust = adjust, data = x, enclos = PF, Surv.response = "either")
  10: evalPopFormula(formula = al$arg, data = data, enclos = enclos, Surv.response = Surv.response)
  11: Surv2DT(y)
  12: data.table(dt)
  13: as.data.table(xi, keep.rownames = keep.rownames)
  14: as.data.table.array(xi, keep.rownames = keep.rownames)
  15: stop("as.data.table.array method should be only called for arrays with 3+ dimensions, for 2 dimensions matrix method should be used")
  
  ── 3. Error: surv.obs about the same as Kaplan-Meier & CIFs close to Aalen-Johan
  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 = "cif.obs") at testthat/test_survtab_observed.R:14
  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")
  
  ── 4. Error: survtab works with more complicated estimation (@test_survtab_obser
  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")
  
  ── 5. Error: relative survivals about the same as relsurv's (@test_survtab_relat
  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")
  
  ── 6. 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: 215 SKIPPED: 41 FAILED: 6
  1. Error: removing consecutively bad surv.ints is logical w/ & w/out adjusting (@test_survtab_bad_surv_ints.R#16) 
  2. Error: survtab_ag messages & results due to non-consecutively bad surv.ints are OK (@test_survtab_bad_surv_ints.R#69) 
  3. Error: surv.obs about the same as Kaplan-Meier & CIFs close to Aalen-Johansen (@test_survtab_observed.R#14) 
  4. Error: survtab works with more complicated estimation (@test_survtab_observed.R#112) 
  5. Error: relative survivals about the same as relsurv's (@test_survtab_relative.R#57) 
  6. Error: evalPopFormula & usePopFormula output is stable (@test_utils.R#251) 
  
  Error: testthat unit tests failed
  Execution halted