This function identifies bouts of physical activity using user-defined breakpoints for accelerometer counts.
markbouts(object, value, which = "counts", bts = c(0, 10, 20, Inf), rescale.epoch = 60,
collapse.by = "%Y-%m-%d", value.labels = NULL, bouts.labels = NULL,
extreme = NULL, keep.error = FALSE, progbar = TRUE)
# S3 method for acclist
markbouts(object, value, which = "counts", bts = c(0, 10, 20, Inf), rescale.epoch = 60,
collapse.by = "%Y-%m-%d", value.labels = NULL, bouts.labels = NULL,
extreme = NULL, keep.error = FALSE, progbar = TRUE)
# S3 method for accfile
markbouts(object, value, which = "counts", bts = c(0, 10, 20, Inf), rescale.epoch = 60,
collapse.by = "%Y-%m-%d", value.labels = NULL, bouts.labels = NULL,
extreme = NULL, keep.error = FALSE, progbar = NULL)
The function markbouts.accfile
returns duration, frequency and mean duration of bouts by bout category, physical activity mode and T
levels of collapse.by
(e.g., day) in array of dimension c(length(bts) - 1,length(value) + 1,3,T)
. markbouts.acclist
is applied to objects of class acclist
, in which case a list of arrays of the same length as the number of accelerometer files in object
is returned.
an object of class acclist
or accfile
.
vector of breaks to define physical activity modes. The lowest breakpoint must be 0.
either 'counts' or 'steps' for gt1m
files or one of c('x','y','z','steps')
for gt3x
files.
vector of breaks to define bouts duration (in minutes).
epoch expressed in the same unit as acceleromenter's epoch to determine multiplier to rescale value
(default is 60). See details.
dataset aggregation level. See argument format
from strptime
for options and details below.
labels for physical activity modes.
labels for bouts duration catergories (NULL
is recommended).
if value
includes a threshold for defining the category of extreme values, this argument identifies such category among the physical activity modes defined by value
. See details.
logical flag. If FALSE
(default) data errors as identified by errorChk
will be replaced by NAs.
logical flag. Should a progress bar be used? Available for Windows only. Argument not used for class accfile
.
Marco Geraci
Breakpoints are specified as counts per seconds using value
. If the epoch used for value
is different from the accelerometer's epoch, a rescaling is applied. E.g., if epoch is 15 seconds and breakpoints are expressed as counts per 60 seconds, value
is divided by 60/15 = 4. There can be n physical activity modes at maximum, where n is the length of value
.
The argument extreme
is NULL
by default. Use either `last' to select the last category or the category number 1 to n.
readAccDir