Learn R Programming

pawacc (version 1.1)

markbouts.acclist: Classify accumulation of physical activity in bouts

Description

This function identifies bouts of physical activity using user-defined breakpoints for accelerometer counts.

Usage

markbouts.acclist(object, value, 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)

markbouts.accfile(object, value, 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)

Arguments

object
an object of class acclist or accfile.
value
vector of breaks to define physical activity modes. The lowest breakpoint must be 0.
bts
vector of breaks to define bouts duration (in minutes).
rescale.epoch
epoch expressed in the same unit as acceleromenter's epoch to determine multiplier to rescale value (default is 60). See details.
collapse.by
dataset aggregation level. See argument format from strptime for options and details below.
value.labels
labels for physical activity modes.
bouts.labels
labels for bouts duration catergories (NULL is recommended).
extreme
keep.error
logical flag. If FALSE (default) data errors as identified by errorCts will be replaced by NAs.

Value

  • 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.

Details

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. Currently, this function is implemented for class gt1m only.

See Also

readAccDir