Running ‘testthat.R’ [9s/31s]
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)
  > 
  > 
  > test_check("simulateDCE")
  Loading required package: simulateDCE
  New names:
  * `Choice situation` -> `Choice.situation`
  * `` -> `...12`
  New names:
  * `Choice situation` -> `Choice.situation`
  * `` -> `...12`
  I guessed it is an ngene file
  New names:
  * `Choice situation` -> `Choice.situation`
  * `` -> `...12`
  New names:
  * `Choice situation` -> `Choice.situation`
  * `` -> `...12`
  I assume it is a spdesign.
  I guessed it is an ngene file
  New names:
  * `Choice situation` -> `Choice.situation`
  * `` -> `...12`
  New names:
  * `Choice situation` -> `Choice.situation`
  * `` -> `...12`
  I assume it is a spdesign.
  I assume it is an idefix design.
  I guessed it is an ngene file
  New names:
  * `Choice situation` -> `Choice.situation`
  * `` -> `...12`
  'simple' is deprecated and will be removed in the future. Use 'exact' instead.
  bcoeff_lookup already exists; skipping modification.
  
  Utility function used in simulation (true utility):
  $u1
  $u1$v1
  V.1 ~ bsq * alt1.sq
  <environment: 0x55be20fd1d40>
  
  $u1$v2
  V.2 ~ bfarm2 * alt2.farm2 + bfarm3 * alt2.farm3 + bheight2 * 
      alt2.height2 + bheight3 * alt2.height3 + bredkite * alt2.redkite + 
      bdistance * alt2.distance + bcost * alt2.cost
  <environment: 0x55be21057708>
  
  $u1$v3
  V.3 ~ bfarm2 * alt3.farm2 + bfarm3 * alt3.farm3 + bheight2 * 
      alt3.height2 + bheight3 * alt3.height3 + bredkite * alt3.redkite + 
      bdistance * alt3.distance + bcost * alt3.cost
  <environment: 0x55be210cc720>
  
  
  'simple' is deprecated and will be removed in the future. Use 'exact' instead.
  bcoeff_lookup already exists; skipping modification.
  
  Utility function used in simulation (true utility):
  $u1
  $u1$v1
  V.1 ~ bsq * alt1.sq
  <environment: 0x55be1cb88a18>
  
  $u1$v2
  V.2 ~ bfarm2 * alt2.farm2 + bfarm3 * alt2.farm3 + bheight2 * 
      alt2.height2 + bheight3 * alt2.height3 + bredkite * alt2.redkite + 
      bdistance * alt2.distance + bcost * alt2.cost
  <environment: 0x55be1ddaf1b8>
  
  $u1$v3
  V.3 ~ bfarm2 * alt3.farm2 + bfarm3 * alt3.farm3 + bheight2 * 
      alt3.height2 + bheight3 * alt3.height3 + bredkite * alt3.redkite + 
      bdistance * alt3.distance + bcost * alt3.cost
  <environment: 0x55be1def7510>
  
  
  
   No preprocess function provided. Proceeding without additional preprocessing.
  
  
  
   dataset preprossed_data exists: FALSE
  
  
   decisiongroups exists: FALSE
  
  Saving _problems/test-sim_all-48.R
  'simple' is deprecated and will be removed in the future. Use 'exact' instead.
  bcoeff_lookup already exists; skipping modification.
  
  Utility function used in simulation (true utility):
  $u1
  $u1$v1
  V.1 ~ bsq * alt1.sq
  <environment: 0x55be23a20680>
  
  $u1$v2
  V.2 ~ bfarm2 * alt2.farm2 + bfarm3 * alt2.farm3 + bheight2 * 
      alt2.height2 + bheight3 * alt2.height3 + bredkite * alt2.redkite + 
      bdistance * alt2.distance + bcost * alt2.cost
  <environment: 0x55be239eada8>
  
  $u1$v3
  V.3 ~ bfarm2 * alt3.farm2 + bfarm3 * alt3.farm3 + bheight2 * 
      alt3.height2 + bheight3 * alt3.height3 + bredkite * alt3.redkite + 
      bdistance * alt3.distance + bcost * alt3.cost
  <environment: 0x55be239b3da0>
  
  
  
   No preprocess function provided. Proceeding without additional preprocessing.
  
  
  
   dataset preprossed_data exists: FALSE
  
  
   decisiongroups exists: FALSE
  
  Saving _problems/test-sim_all-57.R
  'simple' is deprecated and will be removed in the future. Use 'exact' instead.
  bcoeff_lookup already exists; skipping modification.
  
  Utility function used in simulation (true utility):
  $u1
  $u1$v1
  V.1 ~ bsq * alt1.sq
  <environment: 0x55be254b5610>
  
  $u1$v2
  V.2 ~ bfarm2 * alt2.farm2 + bfarm3 * alt2.farm3 + bheight2 * 
      alt2.height2 + bheight3 * alt2.height3 + bredkite * alt2.redkite + 
      bdistance * alt2.distance + bcost * alt2.cost
  <environment: 0x55be2547fd38>
  
  $u1$v3
  V.3 ~ bfarm2 * alt3.farm2 + bfarm3 * alt3.farm3 + bheight2 * 
      alt3.height2 + bheight3 * alt3.height3 + bredkite * alt3.redkite + 
      bdistance * alt3.distance + bcost * alt3.cost
  <environment: 0x55be22976260>
  
  
  
   No preprocess function provided. Proceeding without additional preprocessing.
  
  
  
   dataset preprossed_data exists: FALSE
  
  
   decisiongroups exists: FALSE
  
  Saving _problems/test-sim_all-67.R
  'simple' is deprecated and will be removed in the future. Use 'exact' instead.
  bcoeff_lookup already exists; skipping modification.
  
  Utility function used in simulation (true utility):
  $u1
  $u1$v1
  V.1 ~ bsq * alt1.sq
  <environment: 0x55be2378b850>
  
  $u1$v2
  V.2 ~ bfarm2 * alt2.farm2 + bfarm3 * alt2.farm3 + bheight2 * 
      alt2.height2 + bheight3 * alt2.height3 + bredkite * alt2.redkite + 
      bdistance * alt2.distance + bcost * alt2.cost
  <environment: 0x55be23754068>
  
  $u1$v3
  V.3 ~ bfarm2 * alt3.farm2 + bfarm3 * alt3.farm3 + bheight2 * 
      alt3.height2 + bheight3 * alt3.height3 + bredkite * alt3.redkite + 
      bdistance * alt3.distance + bcost * alt3.cost
  <environment: 0x55be2371d050>
  
  
  
   No preprocess function provided. Proceeding without additional preprocessing.
  
  
  
   dataset preprossed_data exists: FALSE
  
  
   decisiongroups exists: FALSE
  
  Saving _problems/test-sim_all-121.R
  'simple' is deprecated and will be removed in the future. Use 'exact' instead.
  bcoeff_lookup already exists; skipping modification.
  
  Utility function used in simulation (true utility):
  $u1
  $u1$v1
  V.1 ~ bsq * alt1.sq
  <environment: 0x55be22c1ff40>
  
  $u1$v2
  V.2 ~ bfarm2 * alt2.farm2 + bfarm3 * alt2.farm3 + bheight2 * 
      alt2.height2 + bheight3 * alt2.height3 + bredkite * alt2.redkite + 
      bdistance * alt2.distance + bcost * alt2.cost
  <environment: 0x55be252a4778>
  
  $u1$v3
  V.3 ~ bfarm2 * alt3.farm2 + bfarm3 * alt3.farm3 + bheight2 * 
      alt3.height2 + bheight3 * alt3.height3 + bredkite * alt3.redkite + 
      bdistance * alt3.distance + bcost * alt3.cost
  <environment: 0x55be24c7a1e0>
  
  
  
   No preprocess function provided. Proceeding without additional preprocessing.
  
  
  
   dataset preprossed_data exists: FALSE
  
  
   decisiongroups exists: FALSE
  
  Saving _problems/test-sim_all-186.R
  
  Attaching package: 'rlang'
  
  The following object is masked from 'package:formula.tools':
  
      env
  
  
   No preprocess function provided. Proceeding without additional preprocessing.
  
  
  
   dataset preprossed_data exists: FALSE
  
  
   decisiongroups exists: FALSE
  
  Saving _problems/test-simulate_choices-46.R
  
   No preprocess function provided. Proceeding without additional preprocessing.
  
  
  
   dataset preprossed_data exists: FALSE
  
  
   decisiongroups exists: FALSE
  
  Saving _problems/test-simulate_choices-49.R
  [ FAIL 7 | WARN 0 | SKIP 0 | PASS 54 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-sim_all.R:48:5'): seed setting makes code reproducible ─────────
  <purrr_error_indexed/rlang_error/error/condition>
  Error in `purrr::map(designfile, sim_choice, no_sim = nosim, respondents = resps, designtype = designtype, destype = destype, u = u, bcoeff = bcoeff, decisiongroups = decisiongroups, manipulations = manipulations, estimate = estimate, chunks = chunks, utility_transform_type = utility_transform_type, mode = mode, preprocess_function = preprocess_function, savefile = NULL)`: i In index: 1.
  Caused by error:
  i In index: 1.
  Caused by error in `[.data.table`:
  ! attempt access index 19/19 in VECTOR_ELT
  ── Error ('test-sim_all.R:57:5'): No seed setting makes code results different ──
  <purrr_error_indexed/rlang_error/error/condition>
  Error in `purrr::map(designfile, sim_choice, no_sim = nosim, respondents = resps, designtype = designtype, destype = destype, u = u, bcoeff = bcoeff, decisiongroups = decisiongroups, manipulations = manipulations, estimate = estimate, chunks = chunks, utility_transform_type = utility_transform_type, mode = mode, preprocess_function = preprocess_function, savefile = NULL)`: i In index: 1.
  Caused by error:
  i In index: 1.
  Caused by error in `[.data.table`:
  ! attempt access index 19/19 in VECTOR_ELT
  ── Error ('test-sim_all.R:67:5'): exact and simple produce same results ────────
  <purrr_error_indexed/rlang_error/error/condition>
  Error in `purrr::map(designfile, sim_choice, no_sim = nosim, respondents = resps, designtype = designtype, destype = destype, u = u, bcoeff = bcoeff, decisiongroups = decisiongroups, manipulations = manipulations, estimate = estimate, chunks = chunks, utility_transform_type = utility_transform_type, mode = mode, preprocess_function = preprocess_function, savefile = NULL)`: i In index: 1.
  Caused by error:
  i In index: 1.
  Caused by error in `[.data.table`:
  ! attempt access index 19/19 in VECTOR_ELT
  ── Failure ('test-sim_all.R:121:5'): Length of utility functions matches number of decision groups ──
  Expected `sim_all(...)` not to throw any errors.
  Actually got a <purrr_error_indexed> with message:
    i In index: 1.
    Caused by error:
    i In index: 1.
    Caused by error in `[.data.table`:
    ! attempt access index 19/19 in VECTOR_ELT
  ── Error ('test-sim_all.R:186:5'): Simulation results are reasonable ───────────
  <purrr_error_indexed/rlang_error/error/condition>
  Error in `purrr::map(designfile, sim_choice, no_sim = nosim, respondents = resps, designtype = designtype, destype = destype, u = u, bcoeff = bcoeff, decisiongroups = decisiongroups, manipulations = manipulations, estimate = estimate, chunks = chunks, utility_transform_type = utility_transform_type, mode = mode, preprocess_function = preprocess_function, savefile = NULL)`: i In index: 1.
  Caused by error:
  i In index: 1.
  Caused by error in `[.data.table`:
  ! attempt access index 19/19 in VECTOR_ELT
  ── Failure ('test-simulate_choices.R:43:3'): simulate_choices() does not error ──
  Expected `simulate_choices(data = data, bcoeff = bcoeff, u = ul)` not to throw any errors.
  Actually got a <simpleError> with message:
    attempt access index 19/19 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_error(...) at test-simulate_choices.R:43: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. └─simulateDCE::simulate_choices(data = data, bcoeff = bcoeff, u = ul)
   8.   ├─...[]
   9.   └─data.table:::`[.data.table`(...)
  ── Error ('test-simulate_choices.R:49:1'): (code run outside of `test_that()`) ──
  Error in ``[.data.table`(dt, , `:=`((varn), lapply(ufuns[[.GRP]], function(f) f(.SD))), by = group, .SDcols = sdcols)`: attempt access index 19/19 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simulateDCE::simulate_choices(data = data, bcoeff = bcoeff, u = ul) at test-simulate_choices.R:49:1
   2.   ├─...[]
   3.   └─data.table:::`[.data.table`(...)
  
  [ FAIL 7 | WARN 0 | SKIP 0 | PASS 54 ]
  Error:
  ! Test failures.
  Warning messages:
  1: In .Internal(gc(verbose, reset, full)) :
    closing unused connection 4 (<-localhost:11541)
  2: In .Internal(gc(verbose, reset, full)) :
    closing unused connection 5 (<-localhost:11490)
  3: In .Internal(gc(verbose, reset, full)) :
    closing unused connection 4 (<-localhost:11320)
  Execution halted