Running ‘testthat.R’ [5s/5s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(behavr)
  Loading required package: data.table
  
  Attaching package: 'data.table'
  
  The following object is masked from 'package:base':
  
      %notin%
  
  > 
  > test_check("behavr")
  Saving _problems/test-behavr-157.R
  
   ==== METADATA ====
  
  Key: <id>
        id condition    sex
     <int>    <char> <char>
  1:     1         a      M
  2:     2         b      M
  3:     3         c      M
  4:     4         d      F
  5:     5         e      F
  
   ====== DATA ======
  
  Key: <id>
          id     t          x           y eating
       <int> <int>      <num>       <num> <lgcl>
    1:     1     1 -0.6264538 -0.62036668   TRUE
    2:     1     2  0.1836433  0.04211587  FALSE
    3:     1     3 -0.8356286 -0.91092165   TRUE
    4:     1     4  1.5952808  0.15802877   TRUE
    5:     1     5  0.3295078 -0.65458464   TRUE
   ---                                          
  496:     5    96 -2.0908461 -0.30824994   TRUE
  497:     5    97  1.6973939  0.01551524  FALSE
  498:     5    98  1.0638812 -0.44231772   TRUE
  499:     5    99 -0.7666166 -1.63800773  FALSE
  500:     5   100  0.3820076 -0.64140116  FALSE
  behavr table with:
   5	individuals
   2	metavariables
   4	variables
   5e+02	measurements
   1	key (id)
  
   Summary of each individual (one per row):
  Key: <id>
        id condition    sex data_points      time_range
     <int>    <char> <char>       <int>          <char>
  1:     1         a      M         100 [1 -> 100 (99)]
  2:     2         b      M         100 [1 -> 100 (99)]
  3:     3         c      M         100 [1 -> 100 (99)]
  4:     4         d      F         100 [1 -> 100 (99)]
  5:     5         e      F         100 [1 -> 100 (99)]
  behavr table with:
   5	individuals
   2	metavariables
   4	variables
   5e+02	measurements
   1	key (id)
  Saving _problems/test-stitch_on-23.R
  Saving _problems/test-stitch_on-74.R
  Saving _problems/test-toy-data-13.R
  [ FAIL 4 | WARN 0 | SKIP 2 | PASS 74 ]
  
  ══ Skipped tests (2) ═══════════════════════════════════════════════════════════
  • empty test (2): 'test-print_summary.R:3:1', 'test-print_summary.R:12:1'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-behavr.R:157:3'): metadata columns can be extracted without id ──
  Error in ``[.data.table`(out, , `:=`(activity, abs(c(0, diff(sign(0.5 - x))))), by = "id")`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─behavr::toy_dam_data(metadata = met, duration = hours(1)) at test-behavr.R:157:3
   2.   ├─out[, `:=`(activity, abs(c(0, diff(sign(0.5 - x))))), by = "id"]
   3.   ├─behavr:::`[.behavr`(...)
   4.   ├─base::NextMethod()
   5.   └─data.table:::`[.data.table`(...)
  ── Error ('test-stitch_on.R:23:3'): stitch works ───────────────────────────────
  Error in ``[.data.table`(md, , `:=`(lag, as.numeric(as.Date(time_ref__) - as.Date(min(time_ref__)), units = "secs")), by = on)`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─behavr::stitch_on(d, on = "uid") at test-stitch_on.R:23:3
   2.   ├─...[]
   3.   └─data.table:::`[.data.table`(...)
  ── Failure ('test-stitch_on.R:74:3'): stitch fails when overlap ────────────────
  `stitch_on(d, on = "uid")` threw an error with unexpected message.
  Expected match: "overlap"
  Actual message: "attempt access index 5/5 in VECTOR_ELT"
  Backtrace:
      ▆
   1. ├─testthat::expect_error(stitch_on(d, on = "uid"), "overlap") at test-stitch_on.R:74:3
   2. │ └─testthat:::quasi_capture(...)
   3. │   ├─testthat (local) .capture(...)
   4. │   │ └─base::withCallingHandlers(...)
   5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6. └─behavr::stitch_on(d, on = "uid")
   7.   ├─...[]
   8.   └─data.table:::`[.data.table`(...)
  ── Error ('test-toy-data.R:13:3'): toy data returns behavr object ──────────────
  Error in ``[.data.table`(out, , `:=`(activity, abs(c(0, diff(sign(0.5 - x))))), by = "id")`: attempt access index 5/5 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─behavr::toy_dam_data() at test-toy-data.R:13:3
   2.   ├─out[, `:=`(activity, abs(c(0, diff(sign(0.5 - x))))), by = "id"]
   3.   ├─behavr:::`[.behavr`(...)
   4.   ├─base::NextMethod()
   5.   └─data.table:::`[.data.table`(...)
  
  [ FAIL 4 | WARN 0 | SKIP 2 | PASS 74 ]
  Error:
  ! Test failures.
  Execution halted