Running ‘testthat.R’ [1s/2s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(behavr)
  Loading required package: data.table
  > 
  > test_check("behavr")
  ── 1. Error: metadata columns can be extracted without id (@test-behavr.R#157)  
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: toy_dam_data(metadata = met, duration = hours(1)) at testthat/test-behavr.R:157
  2: activity_dt[, velocityFromMovement(.SD), by = "id"]
  3: `[.behavr`(activity_dt, , velocityFromMovement(.SD), by = "id")
  4: NextMethod()
  5: `[.data.table`(activity_dt, , velocityFromMovement(.SD), by = "id")
  
  ── 2. Error: bin_apply works (@test-bin_apply.R#9)  ────────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: expect_identical(dt[, mean(moving), by = t_round]$V1, dt_binned_expr <- bin_apply(dt[, 
         -"id"], moving)$moving) at testthat/test-bin_apply.R:9
  2: quasi_label(enquo(expected), expected.label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: bin_apply(dt[, -"id"], moving)
  5: out[, .(var__ = FUN(var__)), by = b__]
  6: `[.data.table`(out, , .(var__ = FUN(var__)), by = b__)
  
  ── 3. Error: bin_apply works with experssions or strings  (@test-bin_apply.R#21)
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: bin_apply(dt[, -"id"], y = "moving") at testthat/test-bin_apply.R:21
  2: out[, .(var__ = FUN(var__)), by = b__]
  3: `[.data.table`(out, , .(var__ = FUN(var__)), by = b__)
  
  ── 4. Error: bin_apply_all works (@test-bin_apply.R#52)  ───────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: bin_apply_all(dt, y = "moving") at testthat/test-bin_apply.R:52
  2: data[, bin_apply(data = .SD, ...), by = eval(data.table::key(data))]
  3: `[.behavr`(data, , bin_apply(data = .SD, ...), by = eval(data.table::key(data)))
  4: NextMethod()
  5: `[.data.table`(data, , bin_apply(data = .SD, ...), by = eval(data.table::key(data)))
  
  
   ==== METADATA ====
  
        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 ======
  
          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):
  ── 5. Error: summary works (@test-print_summary.R#19)  ─────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: summary(d, detailed = T) at testthat/test-print_summary.R:19
  2: summary.behavr(d, detailed = T)
  3: object[, .(data_points = .N, time_range = sprintf("[%s -> %s (%s)]", min(t), max(t), 
         max(t) - min(t))), by = c(data.table::key(object))]
  4: `[.behavr`(object, , .(data_points = .N, time_range = sprintf("[%s -> %s (%s)]", 
         min(t), max(t), max(t) - min(t))), by = c(data.table::key(object)))
  5: NextMethod()
  6: `[.data.table`(object, , .(data_points = .N, time_range = sprintf("[%s -> %s (%s)]", 
         min(t), max(t), max(t) - min(t))), by = c(data.table::key(object)))
  
  ── 6. Error: stitch works (@test-stitch_on.R#23)  ──────────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: stitch_on(d, on = "uid") at testthat/test-stitch_on.R:23
  2: md[, `:=`(lag, as.numeric(as.Date(time_ref__) - as.Date(min(time_ref__)), units = "secs")), 
         by = on]
  3: `[.data.table`(md, , `:=`(lag, as.numeric(as.Date(time_ref__) - as.Date(min(time_ref__)), 
         units = "secs")), by = on)
  
  ── 7. Failure: stitch fails when overlap (@test-stitch_on.R#74)  ───────────────
  `stitch_on(d, on = "uid")` threw an error with unexpected message.
  Expected match: "overlap"
  Actual message: "SETLENGTH() cannot be applied to an ALTVEC object."
  
  ── 8. Error: toy data returns behavr object (@test-toy-data.R#9)  ──────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: toy_ethoscope_data() at testthat/test-toy-data.R:9
  2: activity_dt[, velocityFromMovement(.SD), by = "id"]
  3: `[.behavr`(activity_dt, , velocityFromMovement(.SD), by = "id")
  4: NextMethod()
  5: `[.data.table`(activity_dt, , velocityFromMovement(.SD), by = "id")
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 63 SKIPPED: 1 FAILED: 8
  1. Error: metadata columns can be extracted without id (@test-behavr.R#157) 
  2. Error: bin_apply works (@test-bin_apply.R#9) 
  3. Error: bin_apply works with experssions or strings  (@test-bin_apply.R#21) 
  4. Error: bin_apply_all works (@test-bin_apply.R#52) 
  5. Error: summary works (@test-print_summary.R#19) 
  6. Error: stitch works (@test-stitch_on.R#23) 
  7. Failure: stitch fails when overlap (@test-stitch_on.R#74) 
  8. Error: toy data returns behavr object (@test-toy-data.R#9) 
  
  Error: testthat unit tests failed
  Execution halted