- using R Under development (unstable) (2025-12-20 r89211)
- using platform: x86_64-pc-linux-gnu
- R was compiled by
gcc-15 (Debian 15.2.0-11) 15.2.0
GNU Fortran (Debian 15.2.0-11) 15.2.0
- running under: Debian GNU/Linux forky/sid
- using session charset: UTF-8
- checking for file ‘synthReturn/DESCRIPTION’ ... OK
- checking extension type ... Package
- this is package ‘synthReturn’ version ‘1.0.0’
- package encoding: UTF-8
- checking CRAN incoming feasibility ... [1s/1s] OK
- checking package namespace information ... OK
- checking package dependencies ... OK
- checking if this is a source package ... OK
- checking if there is a namespace ... OK
- checking for executable files ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking for sufficient/correct file permissions ... OK
- checking whether package ‘synthReturn’ can be installed ... OK
See the install log for details.
- checking package directory ... OK
- checking for future file timestamps ... OK
- checking DESCRIPTION meta-information ... OK
- checking top-level files ... OK
- checking for left-over files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking code files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... [0s/0s] OK
- checking whether the package can be loaded with stated dependencies ... [0s/0s] OK
- checking whether the package can be unloaded cleanly ... [0s/0s] OK
- checking whether the namespace can be loaded with stated dependencies ... [0s/0s] OK
- checking whether the namespace can be unloaded cleanly ... [0s/0s] OK
- checking loading without being on the library search path ... [0s/1s] OK
- checking use of S3 registration ... OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [4s/6s] OK
- checking Rd files ... [0s/0s] OK
- checking Rd metadata ... OK
- checking Rd line widths ... OK
- checking Rd cross-references ... OK
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking Rd contents ... OK
- checking for unstated dependencies in examples ... OK
- checking contents of ‘data’ directory ... OK
- checking data for non-ASCII characters ... [0s/0s] OK
- checking LazyData ... OK
- checking data for ASCII and uncompressed saves ... OK
- checking examples ... [0s/1s] ERROR
Running examples in ‘synthReturn-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: synthReturn
> ### Title: Compute synthetic returns
> ### Aliases: synthReturn
>
> ### ** Examples
>
>
> # Load data in that comes in the synthReturn package
> data(ret_two_evdates)
>
> # -----------------------------------------------
> # Example with Permutation Inference
> # -----------------------------------------------
>
> set.seed(123) # set random seed
>
> # Run synthReturn
> res.placebo <- synthReturn(
+ data = ret_two_evdates,
+ unitname = "unit",
+ treatname = "treat",
+ dname = "date",
+ rname = "ret",
+ edname = "eventdate",
+ estwind = c(-100,-1),
+ eventwind = c(0,5),
+ estobs_min = 1,
+ eventobs_min = 1,
+ inference = "permutation",
+ correction = FALSE,
+ ncontrol_min = 10,
+ ndraws = 10,
+ ncores = 1
+ )
Error in `[.data.table`(out, , `:=`(tau, (1:.N) - which(d == eventdate)), :
attempt access index 3/3 in VECTOR_ELT
Calls: synthReturn ... pre_process_synthReturn -> lapply -> FUN -> [ -> [.data.table
Execution halted
- checking for unstated dependencies in ‘tests’ ... OK
- checking tests ... [5s/4s] ERROR
Running ‘testthat.R’ [5s/4s]
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(synthReturn)
>
> test_check("synthReturn")
Saving _problems/test-ar_comp-18.R
Saving _problems/test-data-81.R
Saving _problems/test-event_panel-17.R
Saving _problems/test-event_panel-44.R
Saving _problems/test-get_sets-16.R
Saving _problems/test-get_sets-41.R
Saving _problems/test-phi_comp-19.R
Saving _problems/test-phi_comp-45.R
Saving _problems/test-pre_process_synthReturn-extended-35.R
Saving _problems/test-pre_process_synthReturn-extended-55.R
Saving _problems/test-print-16.R
Saving _problems/test-print-42.R
Saving _problems/test-synthReturn-comprehensive-20.R
Saving _problems/test-synthReturn-comprehensive-60.R
Saving _problems/test-synthReturn-comprehensive-92.R
Saving _problems/test-synthReturn-comprehensive-118.R
Saving _problems/test-synthReturn-comprehensive-192.R
Saving _problems/test-synthReturn-16.R
[ FAIL 18 | WARN 0 | SKIP 0 | PASS 38 ]
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-ar_comp.R:7:3'): ar_comp exists as internal function ───────────
Error in ``[.data.table`(out, , `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id")`: attempt access index 3/3 in VECTOR_ELT
Backtrace:
▆
1. └─synthReturn::synthReturn(...) at test-ar_comp.R:7:3
2. └─synthReturn:::pre_process_synthReturn(...)
3. └─base::lapply(...)
4. └─synthReturn (local) FUN(X[[i]], ...)
5. ├─out[, `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id"]
6. └─data.table:::`[.data.table`(...)
── Failure ('test-data.R:65:3'): datasets work with synthReturn function ───────
Expected `{ ... }` not to throw any errors.
Actually got a <simpleError> with message:
attempt access index 3/3 in VECTOR_ELT
── Error ('test-event_panel.R:6:3'): event_panel functionality tested through synthReturn ──
Error in ``[.data.table`(out, , `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id")`: attempt access index 3/3 in VECTOR_ELT
Backtrace:
▆
1. └─synthReturn::synthReturn(...) at test-event_panel.R:6:3
2. └─synthReturn:::pre_process_synthReturn(...)
3. └─base::lapply(...)
4. └─synthReturn (local) FUN(X[[i]], ...)
5. ├─out[, `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id"]
6. └─data.table:::`[.data.table`(...)
── Error ('test-event_panel.R:31:3'): event_panel handles different data scenarios ──
Error in ``[.data.table`(out, , `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id")`: attempt access index 3/3 in VECTOR_ELT
Backtrace:
▆
1. └─synthReturn::synthReturn(...) at test-event_panel.R:31:3
2. └─synthReturn:::pre_process_synthReturn(...)
3. └─base::lapply(...)
4. └─synthReturn (local) FUN(X[[i]], ...)
5. ├─out[, `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id"]
6. └─data.table:::`[.data.table`(...)
── Error ('test-get_sets.R:5:3'): get_treat_set and get_control_set work through synthReturn ──
Error in ``[.data.table`(out, , `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id")`: attempt access index 3/3 in VECTOR_ELT
Backtrace:
▆
1. └─synthReturn::synthReturn(...) at test-get_sets.R:5:3
2. └─synthReturn:::pre_process_synthReturn(...)
3. └─base::lapply(...)
4. └─synthReturn (local) FUN(X[[i]], ...)
5. ├─out[, `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id"]
6. └─data.table:::`[.data.table`(...)
── Error ('test-get_sets.R:28:3'): data processing handles missing observations ──
Error in ``[.data.table`(out, , `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id")`: attempt access index 3/3 in VECTOR_ELT
Backtrace:
▆
1. └─synthReturn::synthReturn(...) at test-get_sets.R:28:3
2. └─synthReturn:::pre_process_synthReturn(...)
3. └─base::lapply(...)
4. └─synthReturn (local) FUN(X[[i]], ...)
5. ├─out[, `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id"]
6. └─data.table:::`[.data.table`(...)
── Error ('test-phi_comp.R:8:3'): phi_comp functionality tested through synthReturn ──
Error in ``[.data.table`(out, , `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id")`: attempt access index 3/3 in VECTOR_ELT
Backtrace:
▆
1. └─synthReturn::synthReturn(...) at test-phi_comp.R:8:3
2. └─synthReturn:::pre_process_synthReturn(...)
3. └─base::lapply(...)
4. └─synthReturn (local) FUN(X[[i]], ...)
5. ├─out[, `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id"]
6. └─data.table:::`[.data.table`(...)
── Error ('test-phi_comp.R:33:3'): phi_comp works with permutation inference ───
Error in ``[.data.table`(out, , `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id")`: attempt access index 3/3 in VECTOR_ELT
Backtrace:
▆
1. └─synthReturn::synthReturn(...) at test-phi_comp.R:33:3
2. └─synthReturn:::pre_process_synthReturn(...)
3. └─base::lapply(...)
4. └─synthReturn (local) FUN(X[[i]], ...)
5. ├─out[, `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id"]
6. └─data.table:::`[.data.table`(...)
── Failure ('test-pre_process_synthReturn-extended.R:22:3'): pre_process_synthReturn functionality tested through synthReturn ──
Expected `{ ... }` not to throw any errors.
Actually got a <simpleError> with message:
attempt access index 3/3 in VECTOR_ELT
── Error ('test-pre_process_synthReturn-extended.R:42:3'): synthReturn handles different missing data requirements ──
Error in ``[.data.table`(out, , `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id")`: attempt access index 3/3 in VECTOR_ELT
Backtrace:
▆
1. └─synthReturn::synthReturn(...) at test-pre_process_synthReturn-extended.R:42:3
2. └─synthReturn:::pre_process_synthReturn(...)
3. └─base::lapply(...)
4. └─synthReturn (local) FUN(X[[i]], ...)
5. ├─out[, `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id"]
6. └─data.table:::`[.data.table`(...)
── Error ('test-print.R:5:3'): print.synthReturn displays output correctly ─────
Error in ``[.data.table`(out, , `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id")`: attempt access index 3/3 in VECTOR_ELT
Backtrace:
▆
1. └─synthReturn::synthReturn(...) at test-print.R:5:3
2. └─synthReturn:::pre_process_synthReturn(...)
3. └─base::lapply(...)
4. └─synthReturn (local) FUN(X[[i]], ...)
5. ├─out[, `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id"]
6. └─data.table:::`[.data.table`(...)
── Error ('test-print.R:30:3'): print.synthReturn handles inference results ────
Error in ``[.data.table`(out, , `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id")`: attempt access index 3/3 in VECTOR_ELT
Backtrace:
▆
1. └─synthReturn::synthReturn(...) at test-print.R:30:3
2. └─synthReturn:::pre_process_synthReturn(...)
3. └─base::lapply(...)
4. └─synthReturn (local) FUN(X[[i]], ...)
5. ├─out[, `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id"]
6. └─data.table:::`[.data.table`(...)
── Error ('test-synthReturn-comprehensive.R:6:3'): synthReturn works with basic input parameters ──
Error in ``[.data.table`(out, , `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id")`: attempt access index 3/3 in VECTOR_ELT
Backtrace:
▆
1. └─synthReturn::synthReturn(...) at test-synthReturn-comprehensive.R:6:3
2. └─synthReturn:::pre_process_synthReturn(...)
3. └─base::lapply(...)
4. └─synthReturn (local) FUN(X[[i]], ...)
5. ├─out[, `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id"]
6. └─data.table:::`[.data.table`(...)
── Error ('test-synthReturn-comprehensive.R:46:3'): synthReturn works with placebo inference ──
Error in ``[.data.table`(out, , `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id")`: attempt access index 3/3 in VECTOR_ELT
Backtrace:
▆
1. └─synthReturn::synthReturn(...) at test-synthReturn-comprehensive.R:46:3
2. └─synthReturn:::pre_process_synthReturn(...)
3. └─base::lapply(...)
4. └─synthReturn (local) FUN(X[[i]], ...)
5. ├─out[, `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id"]
6. └─data.table:::`[.data.table`(...)
── Error ('test-synthReturn-comprehensive.R:78:3'): synthReturn works with numeric dates ──
Error in ``[.data.table`(out, , `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id")`: attempt access index 3/3 in VECTOR_ELT
Backtrace:
▆
1. └─synthReturn::synthReturn(...) at test-synthReturn-comprehensive.R:78:3
2. └─synthReturn:::pre_process_synthReturn(...)
3. └─base::lapply(...)
4. └─synthReturn (local) FUN(X[[i]], ...)
5. ├─out[, `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id"]
6. └─data.table:::`[.data.table`(...)
── Error ('test-synthReturn-comprehensive.R:104:3'): synthReturn handles missing observations correctly ──
Error in ``[.data.table`(out, , `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id")`: attempt access index 3/3 in VECTOR_ELT
Backtrace:
▆
1. └─synthReturn::synthReturn(...) at test-synthReturn-comprehensive.R:104:3
2. └─synthReturn:::pre_process_synthReturn(...)
3. └─base::lapply(...)
4. └─synthReturn (local) FUN(X[[i]], ...)
5. ├─out[, `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id"]
6. └─data.table:::`[.data.table`(...)
── Error ('test-synthReturn-comprehensive.R:178:3'): synthReturn argument preservation works ──
Error in ``[.data.table`(out, , `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id")`: attempt access index 3/3 in VECTOR_ELT
Backtrace:
▆
1. └─synthReturn::synthReturn(...) at test-synthReturn-comprehensive.R:178:3
2. └─synthReturn:::pre_process_synthReturn(...)
3. └─base::lapply(...)
4. └─synthReturn (local) FUN(X[[i]], ...)
5. ├─out[, `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id"]
6. └─data.table:::`[.data.table`(...)
── Error ('test-synthReturn.R:5:3'): synthReturn works for 2 event dates, no missing values ──
Error in ``[.data.table`(out, , `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id")`: attempt access index 3/3 in VECTOR_ELT
Backtrace:
▆
1. └─synthReturn::synthReturn(...) at test-synthReturn.R:5:3
2. └─synthReturn:::pre_process_synthReturn(...)
3. └─base::lapply(...)
4. └─synthReturn (local) FUN(X[[i]], ...)
5. ├─out[, `:=`(tau, (1:.N) - which(d == eventdate)), by = "unit_id"]
6. └─data.table:::`[.data.table`(...)
[ FAIL 18 | WARN 0 | SKIP 0 | PASS 38 ]
Error:
! Test failures.
Execution halted
- checking PDF version of manual ... [3s/5s] OK
- checking HTML version of manual ... [1s/1s] OK
- checking for non-standard things in the check directory ... OK
- DONE
Status: 2 ERRORs