Running ‘testthat.R’
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/tests.html
  > # * https://testthat.r-lib.org/reference/test_package.html#special-files
  > 
  > library(testthat)
  > library(arf)
  > 
  > test_check("arf")
  Iteration: 0, Accuracy: 76.77%
  Saving _problems/test-arguments-2.R
  Iteration: 0, Accuracy: 77.21%
  Saving _problems/test-conditions-2.R
  Saving _problems/test-impute-19.R
  Iteration: 0, Accuracy: 76.77%
  Saving _problems/test-input_data-6.R
  Iteration: 0, Accuracy: 74.66%
  Saving _problems/test-input_data-41.R
  Saving _problems/test-return_types-2.R
  Saving _problems/test-return_types-7.R
  Saving _problems/test-return_types-19.R
  Saving _problems/test-return_types-26.R
  Saving _problems/test-return_types-37.R
  Saving _problems/test-return_types-44.R
  Saving _problems/test-return_types-56.R
  Saving _problems/test-return_types-75.R
  Saving _problems/test-return_types-101.R
  Saving _problems/test-return_types-112.R
  Saving _problems/test-return_types-119.R
  Iteration: 0, Accuracy: 77.18%
  Saving _problems/test_expct-2.R
  [ FAIL 17 | WARN 0 | SKIP 0 | PASS 2 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-arguments.R:2:3'): FORDE works with alpha>0 ────────────────────
  Error in ``[.data.table`(tmp2, , `:=`(cnt, .N), by = .(tree, leaf))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─arf::adversarial_rf(iris, parallel = FALSE) at test-arguments.R:2:3
   2.   ├─base::unique(tmp2[, `:=`(cnt, .N), by = .(tree, leaf)])
   3.   ├─tmp2[, `:=`(cnt, .N), by = .(tree, leaf)]
   4.   └─data.table:::`[.data.table`(...)
  ── Error ('test-conditions.R:2:1'): (code run outside of `test_that()`) ────────
  Error in ``[.data.table`(tmp2, , `:=`(cnt, .N), by = .(tree, leaf))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─arf::adversarial_rf(iris, parallel = FALSE) at test-conditions.R:2:1
   2.   ├─base::unique(tmp2[, `:=`(cnt, .N), by = .(tree, leaf)])
   3.   ├─tmp2[, `:=`(cnt, .N), by = .(tree, leaf)]
   4.   └─data.table:::`[.data.table`(...)
  ── Error ('test-impute.R:19:3'): Imputation fills missing values ───────────────
  Error in ``[.data.table`(tmp2, , `:=`(cnt, .N), by = .(tree, leaf))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─arf::impute(iris_na, m = 1, parallel = FALSE) at test-impute.R:19:3
   2.   ├─base::do.call(...)
   3.   └─arf (local) `<fn>`(...)
   4.     ├─base::unique(tmp2[, `:=`(cnt, .N), by = .(tree, leaf)])
   5.     ├─tmp2[, `:=`(cnt, .N), by = .(tree, leaf)]
   6.     └─data.table:::`[.data.table`(...)
  ── Error ('test-input_data.R:6:3'): FORGE works if y is a column name ──────────
  Error in ``[.data.table`(tmp2, , `:=`(cnt, .N), by = .(tree, leaf))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─arf::adversarial_rf(dat, parallel = FALSE) at test-input_data.R:6:3
   2.   ├─base::unique(tmp2[, `:=`(cnt, .N), by = .(tree, leaf)])
   3.   ├─tmp2[, `:=`(cnt, .N), by = .(tree, leaf)]
   4.   └─data.table:::`[.data.table`(...)
  ── Error ('test-input_data.R:41:3'): Imputation works if integers recoded to factors ──
  Error in ``[.data.table`(tmp2, , `:=`(cnt, .N), by = .(tree, leaf))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(arf <- adversarial_rf(dat, parallel = FALSE)) at test-input_data.R:41: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. └─arf::adversarial_rf(dat, parallel = FALSE)
    8.   ├─base::unique(tmp2[, `:=`(cnt, .N), by = .(tree, leaf)])
    9.   ├─tmp2[, `:=`(cnt, .N), by = .(tree, leaf)]
   10.   └─data.table:::`[.data.table`(...)
  ── Error ('test-return_types.R:2:3'): ARF returns ranger object ────────────────
  Error in ``[.data.table`(tmp2, , `:=`(cnt, .N), by = .(tree, leaf))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─arf::adversarial_rf(iris, num_trees = 2, verbose = FALSE, parallel = FALSE) at test-return_types.R:2:3
   2.   ├─base::unique(tmp2[, `:=`(cnt, .N), by = .(tree, leaf)])
   3.   ├─tmp2[, `:=`(cnt, .N), by = .(tree, leaf)]
   4.   └─data.table:::`[.data.table`(...)
  ── Error ('test-return_types.R:7:3'): FORDE returns correct list object ────────
  Error in ``[.data.table`(tmp2, , `:=`(cnt, .N), by = .(tree, leaf))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─arf::adversarial_rf(iris, num_trees = 2, verbose = FALSE, parallel = FALSE) at test-return_types.R:7:3
   2.   ├─base::unique(tmp2[, `:=`(cnt, .N), by = .(tree, leaf)])
   3.   ├─tmp2[, `:=`(cnt, .N), by = .(tree, leaf)]
   4.   └─data.table:::`[.data.table`(...)
  ── Error ('test-return_types.R:19:3'): FORDE categories sum to unity ───────────
  Error in ``[.data.table`(tmp2, , `:=`(cnt, .N), by = .(tree, leaf))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─arf::adversarial_rf(iris, num_trees = 2, verbose = FALSE, parallel = FALSE) at test-return_types.R:19:3
   2.   ├─base::unique(tmp2[, `:=`(cnt, .N), by = .(tree, leaf)])
   3.   ├─tmp2[, `:=`(cnt, .N), by = .(tree, leaf)]
   4.   └─data.table:::`[.data.table`(...)
  ── Error ('test-return_types.R:26:3'): Likelihood calculation returns vector of log-likelihoods ──
  Error in ``[.data.table`(tmp2, , `:=`(cnt, .N), by = .(tree, leaf))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─arf::adversarial_rf(iris, num_trees = 2, verbose = FALSE, parallel = FALSE) at test-return_types.R:26:3
   2.   ├─base::unique(tmp2[, `:=`(cnt, .N), by = .(tree, leaf)])
   3.   ├─tmp2[, `:=`(cnt, .N), by = .(tree, leaf)]
   4.   └─data.table:::`[.data.table`(...)
  ── Error ('test-return_types.R:37:3'): FORGE returns data frame when called with data frame ──
  Error in ``[.data.table`(tmp2, , `:=`(cnt, .N), by = .(tree, leaf))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─arf::adversarial_rf(iris, num_trees = 2, verbose = FALSE, parallel = FALSE) at test-return_types.R:37:3
   2.   ├─base::unique(tmp2[, `:=`(cnt, .N), by = .(tree, leaf)])
   3.   ├─tmp2[, `:=`(cnt, .N), by = .(tree, leaf)]
   4.   └─data.table:::`[.data.table`(...)
  ── Error ('test-return_types.R:44:3'): FORGE returns data table when called with data table ──
  Error in ``[.data.table`(tmp2, , `:=`(cnt, .N), by = .(tree, leaf))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─arf::adversarial_rf(...) at test-return_types.R:44:3
   2.   ├─base::unique(tmp2[, `:=`(cnt, .N), by = .(tree, leaf)])
   3.   ├─tmp2[, `:=`(cnt, .N), by = .(tree, leaf)]
   4.   └─data.table:::`[.data.table`(...)
  ── Error ('test-return_types.R:56:3'): FORGE returns matrix when called with matrix ──
  Error in ``[.data.table`(keep, , `:=`(cnt, .N), by = .(tree, leaf))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─arf::forde(arf, x, parallel = FALSE) at test-return_types.R:56:3
   2.   ├─base::unique(keep[, `:=`(cnt, .N), by = .(tree, leaf)])
   3.   ├─keep[, `:=`(cnt, .N), by = .(tree, leaf)]
   4.   └─data.table:::`[.data.table`(...)
  ── Error ('test-return_types.R:75:3'): FORGE returns correct column types ──────
  Error in ``[.data.table`(tmp2, , `:=`(cnt, .N), by = .(tree, leaf))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─arf::adversarial_rf(dat, num_trees = 2, verbose = FALSE, parallel = FALSE) at test-return_types.R:75:3
   2.   ├─base::unique(tmp2[, `:=`(cnt, .N), by = .(tree, leaf)])
   3.   ├─tmp2[, `:=`(cnt, .N), by = .(tree, leaf)]
   4.   └─data.table:::`[.data.table`(...)
  ── Error ('test-return_types.R:101:3'): FORGE does not round to real data set precision if 'round == FALSE' ──
  Error in ``[.data.table`(tmp2, , `:=`(cnt, .N), by = .(tree, leaf))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─arf::adversarial_rf(iris, num_trees = 2, verbose = FALSE, parallel = FALSE) at test-return_types.R:101:3
   2.   ├─base::unique(tmp2[, `:=`(cnt, .N), by = .(tree, leaf)])
   3.   ├─tmp2[, `:=`(cnt, .N), by = .(tree, leaf)]
   4.   └─data.table:::`[.data.table`(...)
  ── Error ('test-return_types.R:112:3'): FORGE returns factors with same levels (and order of levels) ──
  Error in ``[.data.table`(tmp2, , `:=`(cnt, .N), by = .(tree, leaf))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─arf::adversarial_rf(iris, num_trees = 2, verbose = FALSE, parallel = FALSE) at test-return_types.R:112:3
   2.   ├─base::unique(tmp2[, `:=`(cnt, .N), by = .(tree, leaf)])
   3.   ├─tmp2[, `:=`(cnt, .N), by = .(tree, leaf)]
   4.   └─data.table:::`[.data.table`(...)
  ── Error ('test-return_types.R:119:3'): EXPCT returns factors with same levels (and order of levels) ──
  Error in ``[.data.table`(tmp2, , `:=`(cnt, .N), by = .(tree, leaf))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─arf::adversarial_rf(iris, num_trees = 2, verbose = FALSE, parallel = FALSE) at test-return_types.R:119:3
   2.   ├─base::unique(tmp2[, `:=`(cnt, .N), by = .(tree, leaf)])
   3.   ├─tmp2[, `:=`(cnt, .N), by = .(tree, leaf)]
   4.   └─data.table:::`[.data.table`(...)
  ── Error ('test_expct.R:2:1'): (code run outside of `test_that()`) ─────────────
  Error in ``[.data.table`(tmp2, , `:=`(cnt, .N), by = .(tree, leaf))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─arf::adversarial_rf(iris, parallel = FALSE) at test_expct.R:2:1
   2.   ├─base::unique(tmp2[, `:=`(cnt, .N), by = .(tree, leaf)])
   3.   ├─tmp2[, `:=`(cnt, .N), by = .(tree, leaf)]
   4.   └─data.table:::`[.data.table`(...)
  
  [ FAIL 17 | WARN 0 | SKIP 0 | PASS 2 ]
  Error:
  ! Test failures.
  Execution halted