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