From 743269b1bfd4cf5818d82bdea607a7510a95ea04 Mon Sep 17 00:00:00 2001 From: Vincent van Hees <8362333+vincentvanhees@users.noreply.github.com> Date: Mon, 9 Mar 2026 16:55:12 +0100 Subject: [PATCH 1/2] fixes #89 --- NEWS.md | 4 ++++ R/readActiwatchCount.R | 2 +- tests/testthat/test_readActiwatchCount.R | 8 +++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index d434778..27bcb51 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# Changes in version 1.0.? (release date:??-??-2026) + +- Update readActiwatchCount to handle behaviour upcoming data.table package release. #89 + # Changes in version 1.0.7 (release date:26-11-2025) - Parmay Matrix: diff --git a/R/readActiwatchCount.R b/R/readActiwatchCount.R index 0d47e0b..284bde3 100644 --- a/R/readActiwatchCount.R +++ b/R/readActiwatchCount.R @@ -68,7 +68,7 @@ readActiwatchCount = function(filename = NULL, index = index + 1 } } - D = data.table::fread(input = filename, header = FALSE, sep = ",", + D = data.table::fread(input = filename, sep = ",", skip = index, quote = quote, data.table = FALSE) colnames(D)[1:2] = c("counts", "light") lastCol = ncol(D) diff --git a/tests/testthat/test_readActiwatchCount.R b/tests/testthat/test_readActiwatchCount.R index ed7f1e0..5bf240c 100644 --- a/tests/testthat/test_readActiwatchCount.R +++ b/tests/testthat/test_readActiwatchCount.R @@ -14,8 +14,9 @@ test_that("Actiwatch csv is correctly read", { }) test_that("Actiwatch awd is correctly read", { file = system.file("testfiles/Actiwatch.AWD", package = "GGIRread") - D = readActiwatchCount(filename = file, timeformat = "%d-%b-%Y %H:%M:%S", - desiredtz = "Europe/Amsterdam") + expect_warning(D <- readActiwatchCount(filename = file, timeformat = "%d-%b-%Y %H:%M:%S", + desiredtz = "Europe/Amsterdam"), + regexp = "Detected 1 column names but the data has 3 columns*") expect_equal(D$epochSize, 60) expect_equal(format(D$startTime), "2009-10-01 17:00:00") expect_equal(nrow(D$data), 329) @@ -27,8 +28,9 @@ test_that("Actiwatch awd is correctly read", { test_that("Actiwatch awd error correctly", { file = system.file("testfiles/Actiwatch.AWD", package = "GGIRread") - expect_error(readActiwatchCount(filename = file, + expect_error(expect_warning(readActiwatchCount(filename = file, timeformat = "%d-%m-%Y %H:%M:%S"), + regexp = "Detected 1 column names but the data has 3 columns*"), regexp = "Time format*") expect_error(readActiwatchCount(filename = "", From c3636d456c24ef14c45ce63a93a49619b3d1f96a Mon Sep 17 00:00:00 2001 From: Vincent van Hees <8362333+vincentvanhees@users.noreply.github.com> Date: Mon, 9 Mar 2026 17:09:42 +0100 Subject: [PATCH 2/2] To avoid two PRs, also include minor edits to documentation related to other issue, fixes #79 --- NEWS.md | 4 ++-- README.md | 2 +- man/readParmayMatrix.Rd | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index 27bcb51..9abb6c4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,7 +6,7 @@ - Parmay Matrix: - Fixed minor bug in the conversion of accelerometer and gyroscope readings #82 - - Correct documentation for header structure of bin files in readParmayMatrix #83 + - Correct documentation for header structure of binary files in readParmayMatrix #83 - Update Parmay matrix website in README and readParmayMatrix function documentation #87 - Enhanced robustness when reading partially corrupted files, valid data packets are now processed, while only corrupted sections are skipped #88 @@ -26,7 +26,7 @@ - Fitbit: Fix bug preventing the loading of a sequence of json files. #76 -- Add functions for reading Parmay Tech Matrix sensor (bin/BIN files) with accelerometer, gyroscope, temperature, and heart rate #70. +- Add functions for reading Parmay Tech Matrix sensor (BIN files) with accelerometer, gyroscope, temperature, and heart rate #70. # Changes in version 1.0.3 (release date:07-03-2025) diff --git a/README.md b/README.md index f8a2dc0..38a378b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Brand | Device name | File extension | Data type | GGIRread function Axivity Ltd https://axivity.com/ | AX3 and AX6 | .cwa | raw gravitational units |readAxivity ActivInsights Ltd https://activinsights.com/ | GENEActiv Original and Sleep | .bin | raw gravitational units | readGENEActiv Unilever Discover Ltd | Genea (no longer manufactured) | .bin | raw gravitational units | readGenea -Parmay Tech https://www.matrixwearable.net/ | Matrix | .bin, .BIN | raw gravitational units | readParmayMatrix +Parmay Tech https://www.matrixwearable.net/ | Matrix | .BIN | raw gravitational units | readParmayMatrix ActiGraph | ??? | .csv | count data | readActigraphCount Actiwatch | ??? | .csv and .awd | count data | readActiwatchCount Actical | ??? | .csv | count data | readActicalCount diff --git a/man/readParmayMatrix.Rd b/man/readParmayMatrix.Rd index 0346544..9985f62 100644 --- a/man/readParmayMatrix.Rd +++ b/man/readParmayMatrix.Rd @@ -113,7 +113,7 @@ \references{ For more details on Matrix devices', see: \url{https://www.matrixwearable.net/} - For additional details on Matrix bin/BIN files structure, please contact manufacturer: + For additional details on Matrix BIN files structure, please contact manufacturer: \url{https://www.matrixwearable.net/#!/contact} } \seealso{