Learn R Programming

pawacc (version 1.2.3)

collapse.accfile: Collapse raw accelerometer files into a summary dataset

Description

This function collapses accelerometer data into a dataframe with summary statistics.

Usage

collapse(...)
# S3 method for accfile
collapse(object, which = "counts", palist = list(value = c(0, 100, 1000, 5000, 13000),
rescale.epoch = 60, labels = NULL, extreme = NULL), mwlist = list(value = 20,
nz = 0, rescale.epoch = 60), collapse.by = "%Y-%m-%d", collapse.epoch = 60, aggregate.by =
NULL, FUN.list = list(mean = function(x) mean(x, na.rm = TRUE)),
keep.extreme = FALSE, keep.error = FALSE, ...)

Value

A data frame containing the following variables

collapse.by

aggregation factor

fileid

file identifier

...

named columns according to arguments FUN and labels of palist

Arguments

object

an object of class gt1m.

which

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

palist

list of arguments for markpa.accfile.

mwlist

list of arguments for markwear.accfile.

collapse.by

dataset aggregation level. See argument format from strptime for options and details below.

collapse.epoch

epoch by which time spent in different physical activity modes is summarized. See details.

aggregate.by

pre-collapsing aggregation level for accelerometer values. See argument format from strptime for options.

FUN.list

a named list of functions. See fun.collapse.

keep.extreme

logical flag. If FALSE (default) extreme values will be replaced by NAs. See markpa.accfile.

keep.error

logical flag. If FALSE (default) data errors as identified by errorChk will be replaced by NAs.

...

arguments for dateSummary.

Author

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

markpa.accfile, markwear.accfile, fun.collapse