Running ‘testthat.R’ [10s/16s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > 
  > 
  > library(testthat)
  > test_check("Rcan")
  Loading required package: Rcan
  Type example(Rcan) to see demo of the function.
  Saving _problems/test-Rcan-13.R
  Saving _problems/test-Rcan-34.R
  
  Population with less than 18 age group:
  
            registry_label nb_age_group
                    <fctr>        <num>
   India, Chennai (Madras)           16
           South Australia           17
  
  ASR have been computed for the age group 0-99+
  Cumulative risk have been computed for the age group 0-74
  ASR have been computed for the age group 0-99+
  Saving _problems/test-Rcan-122.R
  
  Population with less than 18 age group:
  
                 registry_label  year nb_age_group
                         <fctr> <int>        <num>
                Brazil, Goiania  1988           17
                Brazil, Goiania  1989           17
                Brazil, Goiania  1990           17
                Brazil, Goiania  1991           17
                Brazil, Goiania  1992           17
                            ---   ---          ---
   USA, Georgia, Atlanta: Black  2003           17
   USA, Georgia, Atlanta: Black  2004           17
   USA, Georgia, Atlanta: Black  2005           17
   USA, Georgia, Atlanta: Black  2006           17
   USA, Georgia, Atlanta: Black  2007           17
  
  ASR have been computed for the age group 0-99+
  Saving _problems/test-Rcan-149.R
  [ FAIL 4 | WARN 3 | SKIP 0 | PASS 3 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-Rcan.R:9:3'): Test csu_group_cases: 1 ──────────────────────────
  Error in ``[.data.table`(dt_data, , `:=`(group_id, .GRP), by = key(dt_data))`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─Rcan::csu_group_cases(...) at test-Rcan.R:9:3
   2.   └─Rcan:::core.csu_group_cases(...)
   3.     ├─dt_data[, `:=`(group_id, .GRP), by = key(dt_data)]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test-Rcan.R:29:3'): Test csu_merge_cases_pop: 1 ─────────────────────
  Error in ``[.data.table`(dt_data, , `:=`(group_id, .GRP), by = key(dt_data))`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─Rcan::csu_group_cases(...) at test-Rcan.R:29:3
   2.   └─Rcan:::core.csu_group_cases(...)
   3.     ├─dt_data[, `:=`(group_id, .GRP), by = key(dt_data)]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test-Rcan.R:120:3'): Test trend: 1 ──────────────────────────────────
  Error in ``[.data.table`(dt_data, , `:=`(CSU_smooth, loess(CSU_T ~ CSU_Y, span = smoothing)$fitted), by = CSU_BY)`: attempt access index 7/7 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─Rcan::csu_time_trend(...) at test-Rcan.R:120:3
   2.   └─Rcan:::core.csu_time_trend(...)
   3.     ├─...[]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test-Rcan.R:147:3'): Test eapc: 1 ───────────────────────────────────
  Error in ``[.data.table`(dt_data, , `:=`(id_group, .GRP), by = group_by)`: attempt access index 8/8 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─Rcan::csu_eapc(...) at test-Rcan.R:147:3
   2.   └─Rcan:::core.csu_eapc(...)
   3.     ├─dt_data[, `:=`(id_group, .GRP), by = group_by]
   4.     └─data.table:::`[.data.table`(...)
  
  [ FAIL 4 | WARN 3 | SKIP 0 | PASS 3 ]
  Error:
  ! Test failures.
  Execution halted