Learn R Programming

pawacc (version 1.1)

readAccDir: Read content of a directory with accelerometer files

Description

This function reads raw files downloaded from accelerometers and stores them in one directory.

Usage

readAccDir(path, model, ext = "dat", counts.pos = 1,
	tz = "Europe/London", sparse = FALSE,
	fault = 32767, save = TRUE, compress = "gzip",
	compression_level = 6,...)

Arguments

path
path to accelerometer files.
model
accelerometer model, either 'gt1m' or 'gt3x'.
ext
file extension without '.' (default is 'dat').
counts.pos
position of first measurement of accelerometer counts. See gt1m.accfile for details.
tz
a character string specifying the timezone to be used for the conversion (see strptime).
sparse
logical flag: should data be stored in sparse format?
fault
numerical value that indicates voltage signal saturation (temporarily used for both accelerometer counts and steps).
save
either logical or character. If logical, save = TRUE stores accelerometer files as .Rdata objects in a new directory ('accRfiles') in path. If the directory already exists, confirmation for overwriting will be prompt
compress
logical or character string specifying whether saving to a named file is to use compression if save = TRUE. See argument compress in save.
compression_level
integer: the level of compression to be used. See argument compression_level in save.
...
not used.

Value

  • Either a set of .Rdata files or a list of objects of class accfile. In both cases, each accelerometer data file is stored as an object of type list and labelled using the data file name. See gt1m.accfile or gt3x.accfile for details.

Details

This is a wrapper function. It reads raw accelerometer files stored in one directory. The argument ext specifies the extension of the files to look for (e.g., 'dat' or 'txt'). Files with different extension and/or sub-directories are ignored. The data format must be consistent with the specification of model.

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

gt1m.accfile, gt3x.accfile, gt1m.acclist, gt3x.acclist