Running 'testthat.R' [16s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(hedgehog)
  > library(simstudy)
  > 
  > data.table::setDTthreads(2) # added to solve CRAN issue
  > test_check("simstudy")
  
  Attaching package: 'data.table'
  
  The following object is masked from 'package:base':
  
      %notin%
  
  Saving _problems/test-generate_correlated_data-1038.R
  Saving _problems/test-generate_correlated_data-1044.R
  Saving _problems/test-generate_correlated_data-1050.R
  Saving _problems/test-generate_correlated_data-1055.R
  Saving _problems/test-generate_correlated_data-1060.R
  Saving _problems/test-generate_correlated_data-1065.R
  Saving _problems/test-generate_correlated_data-1072.R
  Saving _problems/test-generate_correlated_data-1080.R
  Saving _problems/test-generate_correlated_data-1088.R
  Saving _problems/test-generate_correlated_data-1179.R
  Saving _problems/test-generate_correlated_data-1236.R
  Saving _problems/test-generate_correlated_data-1264.R
  Saving _problems/test-generate_correlated_data-1281.R
  Saving _problems/test-generate_correlated_data-1298.R
  Saving _problems/test-generate_correlated_data-1352.R
  Saving _problems/test-generate_correlated_data-1380.R
  Saving _problems/test-generate_correlated_data-1425.R
  Saving _problems/test-generate_correlated_data-1438.R
  Saving _problems/test-generate_correlated_data-1480.R
  Saving _problems/test-generate_correlated_data-1495.R
  Saving _problems/test-generate_correlated_data-1520.R
  Saving _problems/test-missing_data-147.R
  Saving _problems/test-missing_data-186.R
  [ FAIL 23 | WARN 0 | SKIP 307 | PASS 148 ]
  
  ══ Skipped tests (307) ═════════════════════════════════════════════════════════
  • On CRAN (307): 'test-actual-distributions.R:6:3',
    'test-actual-distributions.R:28:3', 'test-add_data.R:7:3',
    'test-add_data.R:14:3', 'test-add_data.R:29:3', 'test-add_data.R:36:3',
    'test-add_data.R:45:3', 'test-add_data.R:59:3', 'test-add_data.R:73:3',
    'test-add_data.R:106:3', 'test-add_data.R:149:3', 'test-add_data.R:181:3',
    'test-add_data.R:224:3', 'test-add_data.R:245:3', 'test-add_data.R:267:3',
    'test-add_data.R:285:3', 'test-add_data.R:299:3', 'test-add_data.R:313:3',
    'test-add_data.R:326:3', 'test-add_data.R:346:3', 'test-add_data.R:374:3',
    'test-add_data.R:391:3', 'test-add_data.R:411:3', 'test-asserts.R:7:3',
    'test-asserts.R:18:3', 'test-asserts.R:25:3', 'test-asserts.R:34:3',
    'test-asserts.R:44:3', 'test-asserts.R:55:3', 'test-asserts.R:62:3',
    'test-asserts.R:69:3', 'test-asserts.R:76:3', 'test-asserts.R:83:3',
    'test-asserts.R:90:3', 'test-asserts.R:99:3', 'test-asserts.R:108:3',
    'test-asserts.R:117:3', 'test-asserts.R:126:3', 'test-asserts.R:137:3',
    'test-asserts.R:144:3', 'test-asserts.R:158:3', 'test-asserts.R:174:3',
    'test-asserts.R:188:3', 'test-asserts.R:206:3', 'test-asserts.R:224:3',
    'test-asserts.R:235:3', 'test-asserts.R:246:3', 'test-asserts.R:257:3',
    'test-asserts.R:268:3', 'test-asserts.R:277:3', 'test-asserts.R:285:3',
    'test-asserts.R:297:3', 'test-asserts.R:307:3', 'test-asserts.R:326:3',
    'test-asserts.R:334:3', 'test-conditions.R:23:3', 'test-conditions.R:52:3',
    'test-define_data.R:12:3', 'test-define_data.R:24:3',
    'test-define_data.R:36:3', 'test-define_data.R:48:3',
    'test-define_data.R:60:3', 'test-define_data.R:72:3',
    'test-define_data.R:84:3', 'test-define_data.R:95:3',
    'test-define_data.R:106:3', 'test-define_data.R:117:3',
    'test-define_data.R:131:3', 'test-define_data.R:146:3',
    'test-define_data.R:161:3', 'test-define_data.R:174:3',
    'test-define_data.R:187:3', 'test-define_data.R:200:3',
    'test-define_data.R:214:3', 'test-define_data.R:229:3',
    'test-define_data.R:244:3', 'test-define_data.R:261:3',
    'test-define_data.R:269:3', 'test-define_data.R:280:3',
    'test-define_data.R:297:3', 'test-define_data.R:305:3',
    'test-define_data.R:313:3', 'test-define_data.R:338:3',
    'test-define_data.R:348:3', 'test-define_data.R:366:3',
    'test-define_data.R:381:3', 'test-define_data.R:394:3',
    'test-define_data.R:412:3', 'test-define_data.R:434:3',
    'test-define_data.R:441:3', 'test-define_data.R:456:3',
    'test-define_data.R:471:3', 'test-define_data.R:493:3',
    'test-define_data.R:515:3', 'test-define_data.R:544:3',
    'test-define_data.R:558:3', 'test-define_data.R:576:3',
    'test-define_data.R:597:3', 'test-define_data.R:619:3',
    'test-define_data.R:648:3', 'test-define_data.R:662:3',
    'test-define_data.R:673:3', 'test-define_data.R:695:3',
    'test-define_data.R:713:3', 'test-define_data.R:731:3',
    'test-define_data.R:747:3', 'test-define_data.R:758:3',
    'test-define_data.R:767:3', 'test-define_data.R:779:3',
    'test-define_data.R:799:3', 'test-define_data.R:817:3',
    'test-define_data.R:833:3', 'test-define_data.R:845:3',
    'test-define_data.R:860:3', 'test-define_data.R:872:3',
    'test-define_data.R:885:3', 'test-define_data.R:899:3',
    'test-define_data.R:907:3', 'test-define_data.R:921:3',
    'test-define_data.R:931:3', 'test-define_data.R:942:3',
    'test-define_data.R:950:3', 'test-define_data.R:978:3',
    'test-define_data.R:993:3', 'test-define_data.R:1005:3',
    'test-define_data.R:1029:3', 'test-define_data.R:1053:3',
    'test-define_data.R:1060:3', 'test-define_data.R:1075:3',
    'test-define_data.R:1087:3', 'test-generate_correlated_data.R:8:3',
    'test-generate_correlated_data.R:24:3',
    'test-generate_correlated_data.R:63:3',
    'test-generate_correlated_data.R:100:3',
    'test-generate_correlated_data.R:121:3',
    'test-generate_correlated_data.R:151:3',
    'test-generate_correlated_data.R:211:3',
    'test-generate_correlated_data.R:230:3',
    'test-generate_correlated_data.R:255:3',
    'test-generate_correlated_data.R:332:3',
    'test-generate_correlated_data.R:352:3',
    'test-generate_correlated_data.R:419:3',
    'test-generate_correlated_data.R:1533:3',
    'test-generate_correlated_data.R:1595:3',
    'test-generate_correlated_data.R:1645:3',
    'test-generate_correlated_data.R:1682:3', 'test-generate_data.R:7:3',
    'test-generate_data.R:38:3', 'test-generate_data.R:52:3',
    'test-generate_data.R:119:3', 'test-generate_data.R:169:3',
    'test-generate_data.R:227:3', 'test-generate_data.R:233:3',
    'test-generate_data.R:251:3', 'test-generate_data.R:280:3',
    'test-generate_data.R:306:3', 'test-generate_data.R:343:3',
    'test-generate_data.R:400:3', 'test-generate_data.R:415:3',
    'test-generate_data.R:434:3', 'test-generate_data.R:465:3',
    'test-generate_data.R:554:3', 'test-generate_data.R:572:3',
    'test-generate_data.R:673:3', 'test-generate_data.R:702:3',
    'test-generate_data.R:734:3', 'test-generate_data.R:757:3',
    'test-generate_data.R:784:3', 'test-generate_data.R:813:3',
    'test-generate_data.R:847:3', 'test-generate_data.R:897:3',
    'test-generate_data.R:987:3', 'test-generate_data.R:1040:3',
    'test-generate_dist.R:7:3', 'test-generate_dist.R:32:3',
    'test-generate_dist.R:57:3', 'test-generate_dist.R:71:3',
    'test-generate_dist.R:97:3', 'test-generate_dist.R:111:3',
    'test-generate_dist.R:129:3', 'test-generate_dist.R:144:3',
    'test-generate_dist.R:149:3', 'test-generate_dist.R:162:3',
    'test-generate_dist.R:182:3', 'test-generate_dist.R:211:3',
    'test-generate_dist.R:233:3', 'test-generate_dist.R:279:3',
    'test-generate_dist.R:321:3', 'test-generate_dist.R:367:3',
    'test-generate_dist.R:404:3', 'test-generate_dist.R:421:3',
    'test-generate_dist.R:436:3', 'test-generate_dist.R:451:3',
    'test-generate_dist.R:473:3', 'test-generate_dist.R:495:3',
    'test-generate_dist.R:539:3', 'test-generate_dist.R:561:3',
    'test-generate_dist.R:587:3', 'test-generate_dist.R:625:3',
    'test-generate_dist.R:659:3', 'test-generate_dist.R:693:3',
    'test-generate_dist.R:723:3', 'test-generate_dist.R:765:3',
    'test-generate_dist.R:791:3', 'test-generate_dist.R:806:3',
    'test-generate_dist.R:821:3', 'test-glue.R:8:3', 'test-glue.R:24:3',
    'test-glue.R:33:3', 'test-group_data.R:7:3', 'test-group_data.R:73:3',
    'test-group_data.R:88:3', 'test-group_data.R:106:3',
    'test-group_data.R:117:3', 'test-group_data.R:129:3',
    'test-group_data.R:142:3', 'test-group_data.R:156:3',
    'test-group_data.R:170:3', 'test-group_data.R:182:3',
    'test-group_data.R:194:3', 'test-group_data.R:206:3',
    'test-group_data.R:221:3', 'test-group_data.R:238:3',
    'test-group_data.R:258:3', 'test-group_data.R:290:3',
    'test-group_data.R:313:3', 'test-group_data.R:337:3',
    'test-group_data.R:360:3', 'test-group_data.R:368:3',
    'test-group_data.R:387:3', 'test-group_data.R:406:3',
    'test-group_data.R:425:3', 'test-group_data.R:459:3',
    'test-group_data.R:485:3', 'test-group_data.R:511:3',
    'test-group_data.R:557:3', 'test-group_data.R:590:3',
    'test-group_data.R:603:3', 'test-group_data.R:617:3',
    'test-group_data.R:632:3', 'test-group_data.R:642:3',
    'test-group_data.R:658:3', 'test-group_data.R:673:3',
    'test-group_data.R:682:3', 'test-group_data.R:691:3',
    'test-group_data.R:703:3', 'test-group_data.R:714:3',
    'test-group_data.R:727:3', 'test-group_data.R:744:3',
    'test-group_data.R:764:3', 'test-group_data.R:777:3',
    'test-group_data.R:785:3', 'test-group_data.R:796:3',
    'test-internal_utility.R:7:3', 'test-internal_utility.R:20:3',
    'test-internal_utility.R:36:3', 'test-internal_utility.R:45:3',
    'test-internal_utility.R:54:3', 'test-internal_utility.R:66:3',
    'test-internal_utility.R:86:3', 'test-internal_utility.R:92:3',
    'test-internal_utility.R:103:3', 'test-internal_utility.R:118:3',
    'test-internal_utility.R:130:3', 'test-internal_utility.R:142:3',
    'test-internal_utility.R:153:3', 'test-internal_utility.R:195:3',
    'test-missing_data.R:192:3', 'test-missing_data.R:250:3',
    'test-survival.R:8:3', 'test-survival.R:35:3', 'test-survival.R:48:3',
    'test-survival.R:72:3', 'test-survival.R:91:3', 'test-survival.R:102:3',
    'test-utility.R:11:3', 'test-utility.R:21:3', 'test-utility.R:46:3',
    'test-utility.R:62:3', 'test-utility.R:72:3', 'test-utility.R:78:3',
    'test-utility.R:84:3', 'test-utility.R:94:3', 'test-utility.R:106:3',
    'test-utility.R:120:3', 'test-utility.R:130:3', 'test-utility.R:137:3',
    'test-utility.R:155:3', 'test-utility.R:229:3', 'test-utility.R:256:3',
    'test-utility.R:263:3', 'test-utility.R:269:3', 'test-utility.R:292:3',
    'test-utility.R:298:3', 'test-utility.R:307:3', 'test-utility.R:366:3',
    'test-utility.R:375:3', 'test-utility.R:383:3', 'test-utility.R:392:3',
    'test-utility.R:401:3', 'test-utility.R:410:3', 'test-utility.R:420:3',
    'test-utility.R:426:3', 'test-utility.R:432:3', 'test-utility.R:438:3',
    'test-utility.R:444:3', 'test-utility.R:450:1'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-generate_correlated_data.R:1038:3'): genCorGen generates data with correct dimensions ──
  Error in ``[.data.table`(dtM, , `:=`(param1, params1[seq]), keyby = seqid)`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::genCorGen(...) at test-generate_correlated_data.R:1038:3
   2.   ├─dtM[, `:=`(param1, params1[seq]), keyby = seqid]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test-generate_correlated_data.R:1044:3'): genCorGen generates data in wide format ──
  Error in ``[.data.table`(dtM, , `:=`(param1, params1[seq]), keyby = seqid)`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::genCorGen(...) at test-generate_correlated_data.R:1044:3
   2.   ├─dtM[, `:=`(param1, params1[seq]), keyby = seqid]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test-generate_correlated_data.R:1050:3'): genCorGen assigns custom column names ──
  Error in ``[.data.table`(dtM, , `:=`(param1, params1[seq]), keyby = seqid)`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::genCorGen(...) at test-generate_correlated_data.R:1050:3
   2.   ├─dtM[, `:=`(param1, params1[seq]), keyby = seqid]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test-generate_correlated_data.R:1055:3'): genCorGen assigns custom column names when wide is not TRUE ──
  Error in ``[.data.table`(dtM, , `:=`(param1, params1[seq]), keyby = seqid)`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::genCorGen(...) at test-generate_correlated_data.R:1055:3
   2.   ├─dtM[, `:=`(param1, params1[seq]), keyby = seqid]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test-generate_correlated_data.R:1060:3'): genCorGen assigns custom id name ──
  Error in ``[.data.table`(dtM, , `:=`(param1, params1[seq]), keyby = seqid)`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::genCorGen(...) at test-generate_correlated_data.R:1060:3
   2.   ├─dtM[, `:=`(param1, params1[seq]), keyby = seqid]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test-generate_correlated_data.R:1065:3'): genCorGen generates data with specified correlation structure ──
  Error in ``[.data.table`(dtM, , `:=`(param1, params1[seq]), keyby = seqid)`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::genCorGen(...) at test-generate_correlated_data.R:1065:3
   2.   ├─dtM[, `:=`(param1, params1[seq]), keyby = seqid]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test-generate_correlated_data.R:1072:3'): genCorGen generates data with specified correlation matrix ──
  Error in ``[.data.table`(dtM, , `:=`(param1, params1[seq]), keyby = seqid)`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::genCorGen(...) at test-generate_correlated_data.R:1072:3
   2.   ├─dtM[, `:=`(param1, params1[seq]), keyby = seqid]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test-generate_correlated_data.R:1079:3'): number of parameters adjusted ──
  Error in ``[.data.table`(dtM, , `:=`(param1, params1[seq]), keyby = seqid)`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::genCorGen(...) at test-generate_correlated_data.R:1079:3
   2.   ├─dtM[, `:=`(param1, params1[seq]), keyby = seqid]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test-generate_correlated_data.R:1087:3'): All distributions work ────
  Error in ``[.data.table`(dtM, , `:=`(param1, params1[seq]), keyby = seqid)`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::genCorGen(...) at test-generate_correlated_data.R:1087:3
   2.   ├─dtM[, `:=`(param1, params1[seq]), keyby = seqid]
   3.   └─data.table:::`[.data.table`(...)
  ── Error ('test-generate_correlated_data.R:1170:3'): addCorGen basic functionality works ──
  Error in ``[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)`: attempt access index 9/9 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::addCorGen(...) at test-generate_correlated_data.R:1170:3
   2.   ├─dtTemp[, `:=`(seq_, 1:.N), keyby = .id]
   3.   └─data.table:::`[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)
  ── Error ('test-generate_correlated_data.R:1236:3'): addCorGen works with wide format (ungrouped data) ──
  Error in ``[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)`: attempt access index 9/9 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::addCorGen(...) at test-generate_correlated_data.R:1236:3
   2.   ├─dtTemp[, `:=`(seq_, 1:.N), keyby = .id]
   3.   └─data.table:::`[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)
  ── Error ('test-generate_correlated_data.R:1264:3'): addCorGen works with long format (grouped data) ──
  Error in ``[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::addCorGen(...) at test-generate_correlated_data.R:1264:3
   2.   ├─dtTemp[, `:=`(seq_, 1:.N), keyby = .id]
   3.   └─data.table:::`[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)
  ── Error ('test-generate_correlated_data.R:1281:3'): addCorGen works with different correlation structures ──
  Error in ``[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)`: attempt access index 9/9 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::addCorGen(...) at test-generate_correlated_data.R:1281:3
   2.   ├─dtTemp[, `:=`(seq_, 1:.N), keyby = .id]
   3.   └─data.table:::`[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)
  ── Error ('test-generate_correlated_data.R:1298:3'): addCorGen works with custom correlation matrices ──
  Error in ``[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)`: attempt access index 9/9 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::addCorGen(...) at test-generate_correlated_data.R:1298:3
   2.   ├─dtTemp[, `:=`(seq_, 1:.N), keyby = .id]
   3.   └─data.table:::`[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)
  ── Error ('test-generate_correlated_data.R:1346:3'): addCorGen works with list of correlation matrices for varying cluster sizes ──
  Error in ``[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::addCorGen(...) at test-generate_correlated_data.R:1346:3
   2.   ├─dtTemp[, `:=`(seq_, 1:.N), keyby = .id]
   3.   └─data.table:::`[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)
  ── Error ('test-generate_correlated_data.R:1370:3'): addCorGen works with custom column names ──
  Error in ``[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)`: attempt access index 9/9 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::addCorGen(...) at test-generate_correlated_data.R:1370:3
   2.   ├─dtTemp[, `:=`(seq_, 1:.N), keyby = .id]
   3.   └─data.table:::`[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)
  ── Error ('test-generate_correlated_data.R:1416:3'): addCorGen EP method works correctly ──
  Error in ``[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)`: attempt access index 9/9 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::addCorGen(...) at test-generate_correlated_data.R:1416:3
   2.   ├─dtTemp[, `:=`(seq_, 1:.N), keyby = .id]
   3.   └─data.table:::`[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)
  ── Error ('test-generate_correlated_data.R:1438:3'): addCorGen handles edge cases ──
  Error in ``[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)`: attempt access index 9/9 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::addCorGen(...) at test-generate_correlated_data.R:1438:3
   2.   ├─dtTemp[, `:=`(seq_, 1:.N), keyby = .id]
   3.   └─data.table:::`[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)
  ── Error ('test-generate_correlated_data.R:1480:3'): addCorGen preserves original data ──
  Error in ``[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)`: attempt access index 9/9 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::addCorGen(...) at test-generate_correlated_data.R:1480:3
   2.   ├─dtTemp[, `:=`(seq_, 1:.N), keyby = .id]
   3.   └─data.table:::`[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)
  ── Error ('test-generate_correlated_data.R:1495:3'): addCorGen returns correct data structure ──
  Error in ``[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)`: attempt access index 9/9 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::addCorGen(...) at test-generate_correlated_data.R:1495:3
   2.   ├─dtTemp[, `:=`(seq_, 1:.N), keyby = .id]
   3.   └─data.table:::`[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)
  ── Error ('test-generate_correlated_data.R:1511:3'): addCorGen works with negBinomial distribution ──
  Error in ``[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)`: attempt access index 9/9 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::addCorGen(...) at test-generate_correlated_data.R:1511:3
   2.   ├─dtTemp[, `:=`(seq_, 1:.N), keyby = .id]
   3.   └─data.table:::`[.data.table`(dtTemp, , `:=`(seq_, 1:.N), keyby = .id)
  ── Error ('test-missing_data.R:147:3'): .addLags throws errors. ────────────────
  Error in ``[.data.table`(dt, , `:=`(.n, .N), keyby = .stratum)`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─simstudy::trtAssign(data, grpName = "rx") at test-missing_data.R:147:3
   2.   ├─dt[, `:=`(.n, .N), keyby = .stratum]
   3.   └─data.table:::`[.data.table`(dt, , `:=`(.n, .N), keyby = .stratum)
  ── Error ('test-missing_data.R:186:3'): LAGS are added as expected. ────────────
  Error in ``[.data.table`(lagdt, , `:=`((lags1[i]), shift(.SD[, lags, with = FALSE], n = 1, fill = 0)), by = id)`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test-missing_data.R:186:3
   2. │ └─testthat::quasi_label(enquo(object), label)
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─simstudy:::.addLags(dataLong, c(origForm, noLAG))
   5.   ├─...[]
   6.   └─data.table:::`[.data.table`(...)
  
  [ FAIL 23 | WARN 0 | SKIP 307 | PASS 148 ]
  Error:
  ! Test failures.
  Execution halted