Last updated on 2025-12-21 11:50:35 CET.
| Package | ERROR | OK |
|---|---|---|
| simulateDCE | 4 | 9 |
Current CRAN status: ERROR: 4, OK: 9
Version: 0.3.1
Check: examples
Result: ERROR
Running examples in ‘simulateDCE-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: sim_all
> ### Title: Is a wrapper for sim_choice executing the simulation over all
> ### designs stored in a specific folder update
> ### Aliases: sim_all
>
> ### ** Examples
>
> library(rlang)
> designpath <- system.file("extdata", "SE_DRIVE", package = "simulateDCE")
> resps <- 120 # number of respondents
> nosim <- 2 # number of simulations to run (about 500 is minimum)
>
> decisiongroups <- c(0, 0.7, 1)
>
> # pass beta coefficients as a list
> bcoeff <- list(
+ b.preis = -0.01,
+ b.lade = -0.07,
+ b.warte = 0.02
+ )
>
> manipulations <- list(
+ alt1.x2 = expr(alt1.x2 / 10),
+ alt1.x3 = expr(alt1.x3 / 10),
+ alt2.x2 = expr(alt2.x2 / 10),
+ alt2.x3 = expr(alt2.x3 / 10)
+ )
>
>
> # place your utility functions here
> ul <- list(
+ u1 =
+
+ list(
+ v1 = V.1 ~ b.preis * alt1.x1 + b.lade * alt1.x2 + b.warte * alt1.x3,
+ v2 = V.2 ~ b.preis * alt2.x1 + b.lade * alt2.x2 + b.warte * alt2.x3
+ ),
+ u2 = list(
+ v1 = V.1 ~ b.preis * alt1.x1,
+ v2 = V.2 ~ b.preis * alt2.x1
+ )
+ )
>
>
> sedrive <- sim_all(
+ nosim = nosim,
+ resps = resps,
+ designpath = designpath,
+ u = ul,
+ bcoeff = bcoeff,
+ decisiongroups = decisiongroups,
+ manipulations = manipulations,
+ utility_transform_type = "exact",
+ mode = "sequential",
+ estimate=FALSE
+ )
bcoeff_lookup already exists; skipping modification.
Utility function used in simulation (true utility):
$u1
$u1$v1
V.1 ~ bpreis * alt1.x1 + blade * alt1.x2 + bwarte * alt1.x3
<environment: 0x5631ae62b3e0>
$u1$v2
V.2 ~ bpreis * alt2.x1 + blade * alt2.x2 + bwarte * alt2.x3
<environment: 0x5631afe22410>
$u2
$u2$v1
V.1 ~ bpreis * alt1.x1
<environment: 0x5631afe45370>
$u2$v2
V.2 ~ bpreis * alt2.x1
<environment: 0x5631afe61070>
I guessed it is an ngene file
New names:
• `Choice situation` -> `Choice.situation`
• `` -> `...10`
No preprocess function provided. Proceeding without additional preprocessing.
dataset preprossed_data exists: FALSE
decisiongroups exists: TRUE
Group counts:
1 2
1007 433
Error in `purrr::map()`:
ℹ In index: 1.
Caused by error in `purrr::map()`:
ℹ In index: 1.
Caused by error in `[.data.table`:
! attempt access index 10/10 in VECTOR_ELT
Backtrace:
▆
1. ├─simulateDCE::sim_all(...)
2. │ ├─... %>% stats::setNames(designname)
3. │ └─purrr::map(...)
4. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
5. │ ├─purrr:::with_indexed_errors(...)
6. │ │ └─base::withCallingHandlers(...)
7. │ ├─purrr:::call_with_cleanup(...)
8. │ └─simulateDCE (local) .f(.x[[i]], ...)
9. │ └─1:no_sim %>% ...
10. ├─stats::setNames(., designname)
11. ├─simulateDCE (local) switchmap(...)
12. │ └─purrr::map(.x, .f, ..., .progress = .progress)
13. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
14. │ ├─purrr:::with_indexed_errors(...)
15. │ │ └─base::withCallingHandlers(...)
16. │ ├─purrr:::call_with_cleanup(...)
17. │ └─simulateDCE (local) .f(.x[[i]], ...)
18. │ └─simulateDCE::simulate_choices(...)
19. │ ├─...[]
20. │ └─data.table:::`[.data.table`(...)
21. └─base::.handleSimpleError(...)
22. └─purrr (local) h(simpleError(msg, call))
23. └─cli::cli_abort(...)
24. └─rlang::abort(...)
Execution halted
Flavor: r-devel-linux-x86_64-debian-clang
Version: 0.3.1
Check: tests
Result: ERROR
Running ‘testthat.R’ [9s/26s]
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: 0x55c50137ebb8>
$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: 0x55c5013d7770>
$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: 0x55c501454d70>
'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: 0x55c4fe4174f0>
$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: 0x55c4fe0a59b8>
$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: 0x55c4fe20ecf8>
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: 0x55c503dfa210>
$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: 0x55c503dc6858>
$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: 0x55c503d8ea08>
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: 0x55c5056f0ec0>
$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: 0x55c5051a7518>
$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: 0x55c50516e5f0>
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: 0x55c503b4a8a8>
$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: 0x55c503b0f280>
$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: 0x55c503ada188>
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: 0x55c50542a568>
$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: 0x55c5034b9ce0>
$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: 0x55c505bdec50>
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:11228)
2: In .Internal(gc(verbose, reset, full)) :
closing unused connection 4 (<-localhost:11243)
Execution halted
Flavor: r-devel-linux-x86_64-debian-clang
Version: 0.3.1
Check: re-building of vignette outputs
Result: ERROR
Error(s) in re-building vignettes:
...
--- re-building ‘SE_Agri-vignette.Rmd’ using rmarkdown
Quitting from SE_Agri-vignette.Rmd:121-126 [output]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NULL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'SE_Agri-vignette.Rmd' failed with diagnostics:
ℹ In index: 1.
Caused by error:
ℹ In index: 1.
Caused by error in `[.data.table`:
! attempt access index 20/20 in VECTOR_ELT
--- failed re-building ‘SE_Agri-vignette.Rmd’
--- re-building ‘SE_drive-vignette.Rmd’ using rmarkdown
Quitting from SE_drive-vignette.Rmd:109-114 [output]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NULL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'SE_drive-vignette.Rmd' failed with diagnostics:
ℹ In index: 1.
Caused by error:
ℹ In index: 1.
Caused by error in `[.data.table`:
! attempt access index 10/10 in VECTOR_ELT
--- failed re-building ‘SE_drive-vignette.Rmd’
--- re-building ‘csa-vignette.Rmd’ using rmarkdown
Quitting from csa-vignette.Rmd:98-103 [output]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NULL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'csa-vignette.Rmd' failed with diagnostics:
ℹ In index: 1.
Caused by error:
ℹ In index: 1.
Caused by error in `[.data.table`:
! attempt access index 13/13 in VECTOR_ELT
--- failed re-building ‘csa-vignette.Rmd’
SUMMARY: processing the following files failed:
‘SE_Agri-vignette.Rmd’ ‘SE_drive-vignette.Rmd’ ‘csa-vignette.Rmd’
Error: Vignette re-building failed.
Execution halted
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc
Version: 0.3.1
Check: examples
Result: ERROR
Running examples in ‘simulateDCE-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: sim_all
> ### Title: Is a wrapper for sim_choice executing the simulation over all
> ### designs stored in a specific folder update
> ### Aliases: sim_all
>
> ### ** Examples
>
> library(rlang)
> designpath <- system.file("extdata", "SE_DRIVE", package = "simulateDCE")
> resps <- 120 # number of respondents
> nosim <- 2 # number of simulations to run (about 500 is minimum)
>
> decisiongroups <- c(0, 0.7, 1)
>
> # pass beta coefficients as a list
> bcoeff <- list(
+ b.preis = -0.01,
+ b.lade = -0.07,
+ b.warte = 0.02
+ )
>
> manipulations <- list(
+ alt1.x2 = expr(alt1.x2 / 10),
+ alt1.x3 = expr(alt1.x3 / 10),
+ alt2.x2 = expr(alt2.x2 / 10),
+ alt2.x3 = expr(alt2.x3 / 10)
+ )
>
>
> # place your utility functions here
> ul <- list(
+ u1 =
+
+ list(
+ v1 = V.1 ~ b.preis * alt1.x1 + b.lade * alt1.x2 + b.warte * alt1.x3,
+ v2 = V.2 ~ b.preis * alt2.x1 + b.lade * alt2.x2 + b.warte * alt2.x3
+ ),
+ u2 = list(
+ v1 = V.1 ~ b.preis * alt1.x1,
+ v2 = V.2 ~ b.preis * alt2.x1
+ )
+ )
>
>
> sedrive <- sim_all(
+ nosim = nosim,
+ resps = resps,
+ designpath = designpath,
+ u = ul,
+ bcoeff = bcoeff,
+ decisiongroups = decisiongroups,
+ manipulations = manipulations,
+ utility_transform_type = "exact",
+ mode = "sequential",
+ estimate=FALSE
+ )
bcoeff_lookup already exists; skipping modification.
Utility function used in simulation (true utility):
$u1
$u1$v1
V.1 ~ bpreis * alt1.x1 + blade * alt1.x2 + bwarte * alt1.x3
<environment: 0x5594d66b8bd0>
$u1$v2
V.2 ~ bpreis * alt2.x1 + blade * alt2.x2 + bwarte * alt2.x3
<environment: 0x5594d7e91950>
$u2
$u2$v1
V.1 ~ bpreis * alt1.x1
<environment: 0x5594d7eb4878>
$u2$v2
V.2 ~ bpreis * alt2.x1
<environment: 0x5594d7ed43e0>
I guessed it is an ngene file
New names:
• `Choice situation` -> `Choice.situation`
• `` -> `...10`
No preprocess function provided. Proceeding without additional preprocessing.
dataset preprossed_data exists: FALSE
decisiongroups exists: TRUE
Group counts:
1 2
1007 433
Error in `purrr::map()`:
ℹ In index: 1.
Caused by error in `purrr::map()`:
ℹ In index: 1.
Caused by error in `[.data.table`:
! attempt access index 10/10 in VECTOR_ELT
Backtrace:
▆
1. ├─simulateDCE::sim_all(...)
2. │ ├─... %>% stats::setNames(designname)
3. │ └─purrr::map(...)
4. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
5. │ ├─purrr:::with_indexed_errors(...)
6. │ │ └─base::withCallingHandlers(...)
7. │ ├─purrr:::call_with_cleanup(...)
8. │ └─simulateDCE (local) .f(.x[[i]], ...)
9. │ └─1:no_sim %>% ...
10. ├─stats::setNames(., designname)
11. ├─simulateDCE (local) switchmap(...)
12. │ └─purrr::map(.x, .f, ..., .progress = .progress)
13. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
14. │ ├─purrr:::with_indexed_errors(...)
15. │ │ └─base::withCallingHandlers(...)
16. │ ├─purrr:::call_with_cleanup(...)
17. │ └─simulateDCE (local) .f(.x[[i]], ...)
18. │ └─simulateDCE::simulate_choices(...)
19. │ ├─...[]
20. │ └─data.table:::`[.data.table`(...)
21. └─base::.handleSimpleError(...)
22. └─purrr (local) h(simpleError(msg, call))
23. └─cli::cli_abort(...)
24. └─rlang::abort(...)
Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc
Version: 0.3.1
Check: tests
Result: ERROR
Running ‘testthat.R’ [7s/20s]
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: 0x55f5c9e64738>
$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: 0x55f5c9ebc278>
$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: 0x55f5c9f357e0>
'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: 0x55f5c649c4c0>
$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: 0x55f5c6928140>
$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: 0x55f5c6cb83a0>
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: 0x55f5cc8f8768>
$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: 0x55f5cc8bb220>
$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: 0x55f5cc886128>
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: 0x55f5ce6a0688>
$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: 0x55f5ce47b7e8>
$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: 0x55f5cdd59610>
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: 0x55f5cc638048>
$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: 0x55f5cc5fe940>
$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: 0x55f5cc5c9848>
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: 0x55f5cd9fa130>
$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: 0x55f5ce0f8d28>
$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: 0x55f5ce12d7f0>
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:11113)
2: In .Internal(gc(verbose, reset, full)) :
closing unused connection 5 (<-localhost:11290)
Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc
Version: 0.3.1
Check: examples
Result: ERROR
Running examples in ‘simulateDCE-Ex.R’ failed
The error most likely occurred in:
> ### Name: sim_all
> ### Title: Is a wrapper for sim_choice executing the simulation over all
> ### designs stored in a specific folder update
> ### Aliases: sim_all
>
> ### ** Examples
>
> library(rlang)
> designpath <- system.file("extdata", "SE_DRIVE", package = "simulateDCE")
> resps <- 120 # number of respondents
> nosim <- 2 # number of simulations to run (about 500 is minimum)
>
> decisiongroups <- c(0, 0.7, 1)
>
> # pass beta coefficients as a list
> bcoeff <- list(
+ b.preis = -0.01,
+ b.lade = -0.07,
+ b.warte = 0.02
+ )
>
> manipulations <- list(
+ alt1.x2 = expr(alt1.x2 / 10),
+ alt1.x3 = expr(alt1.x3 / 10),
+ alt2.x2 = expr(alt2.x2 / 10),
+ alt2.x3 = expr(alt2.x3 / 10)
+ )
>
>
> # place your utility functions here
> ul <- list(
+ u1 =
+
+ list(
+ v1 = V.1 ~ b.preis * alt1.x1 + b.lade * alt1.x2 + b.warte * alt1.x3,
+ v2 = V.2 ~ b.preis * alt2.x1 + b.lade * alt2.x2 + b.warte * alt2.x3
+ ),
+ u2 = list(
+ v1 = V.1 ~ b.preis * alt1.x1,
+ v2 = V.2 ~ b.preis * alt2.x1
+ )
+ )
>
>
> sedrive <- sim_all(
+ nosim = nosim,
+ resps = resps,
+ designpath = designpath,
+ u = ul,
+ bcoeff = bcoeff,
+ decisiongroups = decisiongroups,
+ manipulations = manipulations,
+ utility_transform_type = "exact",
+ mode = "sequential",
+ estimate=FALSE
+ )
bcoeff_lookup already exists; skipping modification.
Utility function used in simulation (true utility):
$u1
$u1$v1
V.1 ~ bpreis * alt1.x1 + blade * alt1.x2 + bwarte * alt1.x3
<environment: 0x561e91fe9b00>
$u1$v2
V.2 ~ bpreis * alt2.x1 + blade * alt2.x2 + bwarte * alt2.x3
<environment: 0x561e92dfae68>
$u2
$u2$v1
V.1 ~ bpreis * alt1.x1
<environment: 0x561e92e2b6c8>
$u2$v2
V.2 ~ bpreis * alt2.x1
<environment: 0x561e92e511c0>
I guessed it is an ngene file
New names:
• `Choice situation` -> `Choice.situation`
• `` -> `...10`
No preprocess function provided. Proceeding without additional preprocessing.
dataset preprossed_data exists: FALSE
decisiongroups exists: TRUE
Group counts:
1 2
1007 433
Error in `purrr::map()`:
ℹ In index: 1.
Caused by error in `purrr::map()`:
ℹ In index: 1.
Caused by error in `[.data.table`:
! attempt access index 10/10 in VECTOR_ELT
Backtrace:
▆
1. ├─simulateDCE::sim_all(...)
2. │ ├─... %>% stats::setNames(designname)
3. │ └─purrr::map(...)
4. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
5. │ ├─purrr:::with_indexed_errors(...)
6. │ │ └─base::withCallingHandlers(...)
7. │ ├─purrr:::call_with_cleanup(...)
8. │ └─simulateDCE (local) .f(.x[[i]], ...)
9. │ └─1:no_sim %>% ...
10. ├─stats::setNames(., designname)
11. ├─simulateDCE (local) switchmap(...)
12. │ └─purrr::map(.x, .f, ..., .progress = .progress)
13. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
14. │ ├─purrr:::with_indexed_errors(...)
15. │ │ └─base::withCallingHandlers(...)
16. │ ├─purrr:::call_with_cleanup(...)
17. │ └─simulateDCE (local) .f(.x[[i]], ...)
18. │ └─simulateDCE::simulate_choices(...)
19. │ ├─...[]
20. │ └─data.table:::`[.data.table`(...)
21. └─base::.handleSimpleError(...)
22. └─purrr (local) h(simpleError(msg, call))
23. └─cli::cli_abort(...)
24. └─rlang::abort(...)
Execution halted
Flavor: r-devel-linux-x86_64-fedora-clang
Version: 0.3.1
Check: tests
Result: ERROR
Running ‘testthat.R’ [14s/52s]
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: 0x55dbc4d142a8>
$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: 0x55dbc4d6fd08>
$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: 0x55dbc4db52d0>
'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: 0x55dbc0ce5b00>
$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: 0x55dbc1139670>
$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: 0x55dbc095c6e8>
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: 0x55dbc930adc8>
$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: 0x55dbc92d35d0>
$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: 0x55dbc929a6a8>
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: 0x55dbc87f5360>
$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: 0x55dbc81d9fc8>
$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: 0x55dbc79ef008>
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: 0x55dbc88a7860>
$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: 0x55dbc6961af8>
$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: 0x55dbc8aef800>
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: 0x55dbc744d3d0>
$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: 0x55dbc7411de0>
$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: 0x55dbc73dac28>
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.localdomain:11456)
2: In .Internal(gc(verbose, reset, full)) :
closing unused connection 4 (<-localhost.localdomain:11319)
Execution halted
Flavor: r-devel-linux-x86_64-fedora-clang
Version: 0.3.1
Check: re-building of vignette outputs
Result: ERROR
Error(s) in re-building vignettes:
--- re-building ‘SE_Agri-vignette.Rmd’ using rmarkdown
Quitting from SE_Agri-vignette.Rmd:121-126 [output]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NULL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'SE_Agri-vignette.Rmd' failed with diagnostics:
ℹ In index: 1.
Caused by error:
ℹ In index: 1.
Caused by error in `[.data.table`:
! attempt access index 20/20 in VECTOR_ELT
--- failed re-building ‘SE_Agri-vignette.Rmd’
--- re-building ‘SE_drive-vignette.Rmd’ using rmarkdown
Quitting from SE_drive-vignette.Rmd:109-114 [output]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NULL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'SE_drive-vignette.Rmd' failed with diagnostics:
ℹ In index: 1.
Caused by error:
ℹ In index: 1.
Caused by error in `[.data.table`:
! attempt access index 10/10 in VECTOR_ELT
--- failed re-building ‘SE_drive-vignette.Rmd’
--- re-building ‘csa-vignette.Rmd’ using rmarkdown
Quitting from csa-vignette.Rmd:98-103 [output]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NULL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'csa-vignette.Rmd' failed with diagnostics:
ℹ In index: 1.
Caused by error:
ℹ In index: 1.
Caused by error in `[.data.table`:
! attempt access index 13/13 in VECTOR_ELT
--- failed re-building ‘csa-vignette.Rmd’
SUMMARY: processing the following files failed:
‘SE_Agri-vignette.Rmd’ ‘SE_drive-vignette.Rmd’ ‘csa-vignette.Rmd’
Error: Vignette re-building failed.
Execution halted
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc
Version: 0.3.1
Check: examples
Result: ERROR
Running examples in ‘simulateDCE-Ex.R’ failed
The error most likely occurred in:
> ### Name: sim_all
> ### Title: Is a wrapper for sim_choice executing the simulation over all
> ### designs stored in a specific folder update
> ### Aliases: sim_all
>
> ### ** Examples
>
> library(rlang)
> designpath <- system.file("extdata", "SE_DRIVE", package = "simulateDCE")
> resps <- 120 # number of respondents
> nosim <- 2 # number of simulations to run (about 500 is minimum)
>
> decisiongroups <- c(0, 0.7, 1)
>
> # pass beta coefficients as a list
> bcoeff <- list(
+ b.preis = -0.01,
+ b.lade = -0.07,
+ b.warte = 0.02
+ )
>
> manipulations <- list(
+ alt1.x2 = expr(alt1.x2 / 10),
+ alt1.x3 = expr(alt1.x3 / 10),
+ alt2.x2 = expr(alt2.x2 / 10),
+ alt2.x3 = expr(alt2.x3 / 10)
+ )
>
>
> # place your utility functions here
> ul <- list(
+ u1 =
+
+ list(
+ v1 = V.1 ~ b.preis * alt1.x1 + b.lade * alt1.x2 + b.warte * alt1.x3,
+ v2 = V.2 ~ b.preis * alt2.x1 + b.lade * alt2.x2 + b.warte * alt2.x3
+ ),
+ u2 = list(
+ v1 = V.1 ~ b.preis * alt1.x1,
+ v2 = V.2 ~ b.preis * alt2.x1
+ )
+ )
>
>
> sedrive <- sim_all(
+ nosim = nosim,
+ resps = resps,
+ designpath = designpath,
+ u = ul,
+ bcoeff = bcoeff,
+ decisiongroups = decisiongroups,
+ manipulations = manipulations,
+ utility_transform_type = "exact",
+ mode = "sequential",
+ estimate=FALSE
+ )
bcoeff_lookup already exists; skipping modification.
Utility function used in simulation (true utility):
$u1
$u1$v1
V.1 ~ bpreis * alt1.x1 + blade * alt1.x2 + bwarte * alt1.x3
<environment: 0x2e81d548>
$u1$v2
V.2 ~ bpreis * alt2.x1 + blade * alt2.x2 + bwarte * alt2.x3
<environment: 0x2fc977b8>
$u2
$u2$v1
V.1 ~ bpreis * alt1.x1
<environment: 0x2fcc3d78>
$u2$v2
V.2 ~ bpreis * alt2.x1
<environment: 0x2fce09c8>
I guessed it is an ngene file
New names:
• `Choice situation` -> `Choice.situation`
• `` -> `...10`
No preprocess function provided. Proceeding without additional preprocessing.
dataset preprossed_data exists: FALSE
decisiongroups exists: TRUE
Group counts:
1 2
1007 433
Error in `purrr::map()`:
ℹ In index: 1.
Caused by error in `purrr::map()`:
ℹ In index: 1.
Caused by error in `[.data.table`:
! attempt access index 10/10 in VECTOR_ELT
Backtrace:
▆
1. ├─simulateDCE::sim_all(...)
2. │ ├─... %>% stats::setNames(designname)
3. │ └─purrr::map(...)
4. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
5. │ ├─purrr:::with_indexed_errors(...)
6. │ │ └─base::withCallingHandlers(...)
7. │ ├─purrr:::call_with_cleanup(...)
8. │ └─simulateDCE (local) .f(.x[[i]], ...)
9. │ └─1:no_sim %>% ...
10. ├─stats::setNames(., designname)
11. ├─simulateDCE (local) switchmap(...)
12. │ └─purrr::map(.x, .f, ..., .progress = .progress)
13. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
14. │ ├─purrr:::with_indexed_errors(...)
15. │ │ └─base::withCallingHandlers(...)
16. │ ├─purrr:::call_with_cleanup(...)
17. │ └─simulateDCE (local) .f(.x[[i]], ...)
18. │ └─simulateDCE::simulate_choices(...)
19. │ ├─...[]
20. │ └─data.table:::`[.data.table`(...)
21. └─base::.handleSimpleError(...)
22. └─purrr (local) h(simpleError(msg, call))
23. └─cli::cli_abort(...)
24. └─rlang::abort(...)
Execution halted
Flavor: r-devel-linux-x86_64-fedora-gcc
Version: 0.3.1
Check: tests
Result: ERROR
Running ‘testthat.R’ [13s/49s]
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: 0x194aaea8>
$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: 0x1a320e30>
$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: 0x18879710>
'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: 0x18f0fa58>
$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: 0x190713a0>
$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: 0x190dd708>
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: 0x1cda1a90>
$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: 0x1cd6c1b8>
$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: 0x1cd31370>
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: 0x1e00fdf8>
$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: 0x1e202cb0>
$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: 0x1e1cfad8>
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: 0x1cad71d8>
$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: 0x1ca9f9e0>
$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: 0x1ca64b98>
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: 0x1dff0648>
$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: 0x1be94a08>
$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: 0x1e2c6640>
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.localdomain:11499)
2: In .Internal(gc(verbose, reset, full)) :
closing unused connection 5 (<-localhost.localdomain:11477)
Execution halted
Flavor: r-devel-linux-x86_64-fedora-gcc