- using R Under development (unstable) (2025-12-23 r89222 ucrt)
- using platform: x86_64-w64-mingw32
- R was compiled by
gcc.exe (GCC) 14.3.0
GNU Fortran (GCC) 14.3.0
- running under: Windows Server 2022 x64 (build 20348)
- using session charset: UTF-8
- checking for file 'topdowntimeratio/DESCRIPTION' ... OK
- checking extension type ... Package
- this is package 'topdowntimeratio' version '0.1.0'
- package encoding: UTF-8
- checking package namespace information ... OK
- checking package dependencies ... OK
- checking if this is a source package ... OK
- checking if there is a namespace ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking whether package 'topdowntimeratio' can be installed ... OK
See the install log for details.
- checking installed package size ... OK
- checking package directory ... OK
- checking DESCRIPTION meta-information ... OK
- checking top-level files ... OK
- checking for left-over files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking code files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... [1s] OK
- checking whether the package can be loaded with stated dependencies ... [0s] OK
- checking whether the package can be unloaded cleanly ... [1s] OK
- checking whether the namespace can be loaded with stated dependencies ... [1s] OK
- checking whether the namespace can be unloaded cleanly ... [1s] OK
- checking loading without being on the library search path ... [1s] OK
- checking use of S3 registration ... OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [3s] OK
- checking Rd files ... [1s] NOTE
checkRd: (-1) getSegsExtra.Rd:14: Lost braces
14 | \item{data}{data.table returned from function /code{tdtr}}
| ^
- checking Rd metadata ... OK
- checking Rd cross-references ... OK
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking Rd contents ... OK
- checking for unstated dependencies in examples ... OK
- checking examples ... [1s] ERROR
Running examples in 'topdowntimeratio-Ex.R' failed
The error most likely occurred in:
> ### Name: getSegments
> ### Title: Get Segments
> ### Aliases: getSegments
>
> ### ** Examples
>
> df <- data.frame(entity_id = rep(1, 12),
+ timestamp = c(1, 2, 4, 10, 14, 18, 20, 21, 24, 25, 28, 29),
+ lon = c(5.1299311, 5.129979, 5.129597, 5.130028, 5.130555, 5.131083,
+ 5.132101, 5.132704, 5.133326, 5.133904, 5.134746, 5.135613),
+ lat = c(52.092839, 52.092827, 52.092571, 52.092292, 52.092076, 52.091821,
+ 52.091420, 52.091219, 52.091343, 52.091651, 52.092138, 52.092698))
> # First generate segments
> res30 <- tdtr(df,
+ group_col = NULL,
+ max_error = 30)
Error in `[.data.table`(data, , `:=`(seg_start_lat = lat[1L], seg_start_lon = lon[1L], :
attempt access index 10/10 in VECTOR_ELT
Calls: tdtr -> controlLoop -> setup -> [ -> [.data.table
Execution halted
- checking for unstated dependencies in 'tests' ... OK
- checking tests ... [2s] ERROR
Running 'spelling.R' [0s]
Running 'testthat.R' [2s]
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
- checking PDF version of manual ... [19s] OK
- checking HTML version of manual ... [3s] OK
- DONE
Status: 2 ERRORs, 1 NOTE