Learn R Programming

pawacc (version 1.1)

markwear.acclist: Classify wear and non-wear time

Description

This functions identifies sequences of zeroes of a given length to classify wear and non-wear time in accelerometer data files.

Usage

markwear.acclist(object, value, nz = 0, keep.error = FALSE)
markwear.accfile(object, value, nz = 0, keep.error = FALSE)

Arguments

object
an object of class acclist or accfile.
value
the length of the time window (in minutes) which contains zero values.
nz
the length of the time window (in minutes) of non-zero value sequences allowed between every two sequences of zero values.
keep.error
logical flag. If FALSE (default) data errors as identified by errorCts will be replaced by NAs.

Value

  • If object is of class acclist, a list of factors with two levels of the same length as the number of accelerometers files in object. If object is of class accfile, a single factor will be given. Levels are 'non-wear' and 'wear'.

Details

Currently, this function is implemented for class gt1m only. The accelerometer epoch is assumed to be expressed in seconds. Therefore value is automatically rescaled to value * 60/object$info$epoch.

References

Geraci M, Rich C, Sera F, Cortina-Borja M, Griffiths LJ, and Dezateux C (2012). Technical report on accelerometry data processing in the Millennium Cohort Study. London, UK: University College London. Available at http://discovery.ucl.ac.uk/1361699

See Also

readAccDir

Examples

Run this code
data(gt1m_sample)

# 20-minute threshold
wear <- markwear.accfile(gt1m_sample, value = 20)
> table(wear)
 wear
 Non-wear     Wear 
    27572    17338

# lower threshold
wear <- markwear.accfile(gt1m_sample, value = 5)
> table(wear)
 wear
 Non-wear     Wear 
    30188    14722

# allow for some non-zero values within a 20-minute window
wear <- markwear.accfile(gt1m_sample, value = 20, nz = 2)
> table(wear)
 wear
 Non-wear     Wear 
   28198    16712

Run the code above in your browser using DataLab