readAccDir: Read content of a directory with accelerometer files

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

Description

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

Usage

1
2
3
4
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 gt1mAccFile 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 prompted. save = FALSE stores accelerometer files in current R session. Alternatively, an existing folder can be specified.

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.

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.

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 gt1mAccFile or gt3xAccFile for details.

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

gt1mAccFile, gt3xAccFile, gt1mAccDir, gt3xAccDir


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