markwear.acclist {pawacc}R Documentation

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(object, value, which = "counts", rescale.epoch = 60,
	nz = 0, keep.error = FALSE, progbar = TRUE)
## S3 method for class 'acclist'
markwear(object, value, which = "counts", rescale.epoch = 60,
	nz = 0, keep.error = FALSE, progbar = TRUE)
## S3 method for class 'accfile'
markwear(object, value, which = "counts", rescale.epoch = 60,
	nz = 0, keep.error = FALSE, progbar = NULL)

Arguments

object

an object of class acclist or accfile.

value

the length of the time window (in minutes) which contains zero values.

which

either 'counts' or 'steps' for gt1m files or one of c('x','y','z','steps') for gt3x files.

rescale.epoch

epoch expressed in the same unit as acceleromenter epoch to determine multiplier to rescale value (default is 60). See details.

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 errorChk will be replaced by NAs.

progbar

logical flag. Should a progress bar be used? Available for Windows only. Argument not used for class accfile.

Details

The accelerometer epoch is assumed to be expressed in seconds. Therefore value is automatically rescaled to value * 60/object$info$epoch.

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

Author(s)

Marco Geraci

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 https://discovery.ucl.ac.uk/1361699

See Also

readAccDir

Examples


## Not run: 

data(gt1m_sample)

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

## End(Not run)

## Not run: 

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

## End(Not run)

## Not run: 

# 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 

## End(Not run)


[Package pawacc version 1.2.3 Index]