Skip to content

Commit 743269b

Browse files
fixes #89
1 parent f54692b commit 743269b

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Changes in version 1.0.? (release date:??-??-2026)
2+
3+
- Update readActiwatchCount to handle behaviour upcoming data.table package release. #89
4+
15
# Changes in version 1.0.7 (release date:26-11-2025)
26

37
- Parmay Matrix:

R/readActiwatchCount.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ readActiwatchCount = function(filename = NULL,
6868
index = index + 1
6969
}
7070
}
71-
D = data.table::fread(input = filename, header = FALSE, sep = ",",
71+
D = data.table::fread(input = filename, sep = ",",
7272
skip = index, quote = quote, data.table = FALSE)
7373
colnames(D)[1:2] = c("counts", "light")
7474
lastCol = ncol(D)

tests/testthat/test_readActiwatchCount.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ test_that("Actiwatch csv is correctly read", {
1414
})
1515
test_that("Actiwatch awd is correctly read", {
1616
file = system.file("testfiles/Actiwatch.AWD", package = "GGIRread")
17-
D = readActiwatchCount(filename = file, timeformat = "%d-%b-%Y %H:%M:%S",
18-
desiredtz = "Europe/Amsterdam")
17+
expect_warning(D <- readActiwatchCount(filename = file, timeformat = "%d-%b-%Y %H:%M:%S",
18+
desiredtz = "Europe/Amsterdam"),
19+
regexp = "Detected 1 column names but the data has 3 columns*")
1920
expect_equal(D$epochSize, 60)
2021
expect_equal(format(D$startTime), "2009-10-01 17:00:00")
2122
expect_equal(nrow(D$data), 329)
@@ -27,8 +28,9 @@ test_that("Actiwatch awd is correctly read", {
2728

2829
test_that("Actiwatch awd error correctly", {
2930
file = system.file("testfiles/Actiwatch.AWD", package = "GGIRread")
30-
expect_error(readActiwatchCount(filename = file,
31+
expect_error(expect_warning(readActiwatchCount(filename = file,
3132
timeformat = "%d-%m-%Y %H:%M:%S"),
33+
regexp = "Detected 1 column names but the data has 3 columns*"),
3234
regexp = "Time format*")
3335

3436
expect_error(readActiwatchCount(filename = "",

0 commit comments

Comments
 (0)