Running ‘spelling.R’ [0s/0s]
  Running ‘testthat.R’ [2s/3s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(topdowntimeratio)
  
  Attaching package: 'topdowntimeratio'
  
  The following object is masked from 'package:testthat':
  
      setup
  
  > 
  > test_check("topdowntimeratio")
  Saving _problems/test-segments-13.R
  Saving _problems/test-segments-21.R
  Saving _problems/test-segments-48.R
  Saving _problems/test-tsiter-21.R
  [ FAIL 4 | WARN 0 | SKIP 0 | PASS 5 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-segments.R:13:3'): getSegments returns correct number of segments ──
  Error in ``[.data.table`(data, , `:=`(seg_start_lat = lat[1L], seg_start_lon = lon[1L], seg_start_time = timestamp_numeric[1L], seg_end_lat = lat[.N], seg_end_lon = lon[.N], seg_end_time = timestamp_numeric[.N]), segment_id)`: attempt access index 10/10 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─topdowntimeratio::getSegments(tdtr(df, n_segs = 1, group_col = NULL)) at test-segments.R:13:3
   2. └─topdowntimeratio::tdtr(df, n_segs = 1, group_col = NULL)
   3.   └─topdowntimeratio:::controlLoop(...)
   4.     └─topdowntimeratio::setup(data)
   5.       ├─...[]
   6.       └─data.table:::`[.data.table`(...)
  ── Error ('test-segments.R:21:3'): segment distance is correct ─────────────────
  Error in ``[.data.table`(data, , `:=`(seg_start_lat = lat[1L], seg_start_lon = lon[1L], seg_start_time = timestamp_numeric[1L], seg_end_lat = lat[.N], seg_end_lon = lon[.N], seg_end_time = timestamp_numeric[.N]), segment_id)`: attempt access index 10/10 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─topdowntimeratio::getSegments(tdtr(df, n_segs = 2, group_col = NULL)) at test-segments.R:21:3
   2. └─topdowntimeratio::tdtr(df, n_segs = 2, group_col = NULL)
   3.   └─topdowntimeratio:::controlLoop(...)
   4.     └─topdowntimeratio::setup(data)
   5.       ├─...[]
   6.       └─data.table:::`[.data.table`(...)
  ── Error ('test-segments.R:48:3'): getSegsExtra returns correct number of segments ──
  Error in ``[.data.table`(data, , `:=`(seg_start_lat = lat[1L], seg_start_lon = lon[1L], seg_start_time = timestamp_numeric[1L], seg_end_lat = lat[.N], seg_end_lon = lon[.N], seg_end_time = timestamp_numeric[.N]), segment_id)`: attempt access index 10/10 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─topdowntimeratio::getSegsExtra(tdtr(df, n_segs = 1, group_col = NULL)) at test-segments.R:48:3
   2. │ └─data.table::copy(data)
   3. └─topdowntimeratio::tdtr(df, n_segs = 1, group_col = NULL)
   4.   └─topdowntimeratio:::controlLoop(...)
   5.     └─topdowntimeratio::setup(data)
   6.       ├─...[]
   7.       └─data.table:::`[.data.table`(...)
  ── Error ('test-tsiter.R:12:1'): (code run outside of `test_that()`) ───────────
  Error in ``[.data.table`(data, , `:=`(seg_start_lat = lat[1L], seg_start_lon = lon[1L], seg_start_time = timestamp_numeric[1L], seg_end_lat = lat[.N], seg_end_lon = lon[.N], seg_end_time = timestamp_numeric[.N]), segment_id)`: attempt access index 10/10 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─topdowntimeratio::tdtr(...) at test-tsiter.R:12:1
   2.   └─topdowntimeratio:::controlLoop(...)
   3.     └─topdowntimeratio::setup(data)
   4.       ├─...[]
   5.       └─data.table:::`[.data.table`(...)
  
  [ FAIL 4 | WARN 0 | SKIP 0 | PASS 5 ]
  Error:
  ! Test failures.
  Execution halted