markwear.acclist: Classify wear and non-wear time

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

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

Usage

1
2
3
4
5
6
7
8
markwear(object, value, which = "counts", rescale.epoch = 60,
	nz = 0, keep.error = FALSE)
## S3 method for class 'acclist'
markwear(object, value, which = "counts", rescale.epoch = 60,
	nz = 0, keep.error = FALSE)
## S3 method for class 'accfile'
markwear(object, value, which = "counts", rescale.epoch = 60,
	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.

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.

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

See Also

readAccDir

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
## 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)

pawacc documentation built on May 2, 2019, 5:20 p.m.