Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: GGIRread
Type: Package
Title: Wearable Accelerometer Data File Readers
Version: 1.0.10
Date: 2026-08-26
Version: 1.0.11
Date: 2026-09-07
Authors@R: c(person("Vincent T","van Hees",role=c("aut","cre"),
email="v.vanhees@accelting.com"),
person(given = "Patrick",family = "Bos",
Expand All @@ -15,6 +15,7 @@ Authors@R: c(person("Vincent T","van Hees",role=c("aut","cre"),
person("Dan","Jackson",role="ctb"),
person("Jairo H","Migueles",role="ctb"),
person("John","Muschelli",role="ctb"),
person("Jia Ying","Chua",role="ctb"),
person("Medical Research Council UK", role = c("cph", "fnd")),
person("Accelting", role = c("cph", "fnd")))
Maintainer: Vincent T van Hees <v.vanhees@accelting.com>
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Changes in version 1.0.11 (release date:07-09-2026)

- Added GENEActiv light calibration needed for device model GENEActiv 1.2 and above. Contributed by ActivInsights Ltd, the manufacturer of GENEActiv devices.

# Changes in version 1.0.10 (release date:26-08-2026)

- Fix bug in readGENEActiv with `path.expand`. #94 @muschellij2
Expand Down
31 changes: 26 additions & 5 deletions R/readGENEActiv.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,33 @@ readGENEActiv = function(filename, start = 0, end = 0, progress_bar = FALSE,
}
starttime_num = as.numeric(starttime_posix) + page_offset
rawdata$time = rawdata$time + abs(rawdata$time[1]) + starttime_num

# Apply device-specific light calibration
light <- rawdata$lux

if (grepl("1\\.1$", DeviceModel)) {
light <- light * (Lux / Volts)
} else {
light <- ifelse(light < 256, light,
ifelse(light < 512, (light - 128) * 2,
ifelse(light < 768, (light - 320) * 4,
ifelse(light < 1024, (light - 656) * 16,
5888
)
)
)
)
light <- light * (Lux / Volts)
}

return(invisible(list(
header = header,
data.out = data.frame(time = rawdata$time,
x = rawdata$x, y = rawdata$y, z = rawdata$z,
light = rawdata$lux * (Lux/Volts),
temperature = rawdata$temperature,
stringsAsFactors = TRUE)
data.out = data.frame(
time = rawdata$time,
x = rawdata$x, y = rawdata$y, z = rawdata$z,
light = light,
temperature = rawdata$temperature,
stringsAsFactors = TRUE
)
)))
}
20 changes: 14 additions & 6 deletions man/readGENEActiv.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,20 @@
}
\details{
If only \code{start} page is defined then all data is read beyond
\code{start} until the end of the file is reached
\code{start} until the end of the file is reached.

GENEActiv light measurements are calibrated according to the device model.
For GENEActiv 1.1, the existing light calibration is applied.
For GENEActiv 1.2 and above, an additional correction is applied to account for
the light sensor's non-linear scaling with graded resolution. This provides
greater accuracy at low light levels while supporting a higher range.
This correction was provided by ActivInsights Ltd, the manufacturer
of GENEActiv devices.
}
\value{

header:

\item{serial_number}{Device serial number as extracted from file header}
\item{firmware}{Firmware version}
\item{tzone}{Time zone as extracted from file header}
Expand All @@ -49,9 +57,9 @@
\item{ReadErrors}{matrix with battery voltage and corresponding timestamps}
\item{numBlocksTotal}{matrix with battery voltage and corresponding timestamps}
\item{StartTime}{Start time as extracted from file header}

data.out:

\item{time}{Unix time in seconds with decimal places for miliseconds}
\item{x}{see \link{GENEActivReader}}
\item{y}{see \link{GENEActivReader}}
Expand All @@ -67,4 +75,4 @@
\author{
Patrick Bos <egpbos@gmail.com>
Vincent T van Hees <v.vanhees@accelting.com>
}
}
Loading