Learn R Programming

pawacc (version 1.1)

gt1m.accfile: Read a single accelerometer file

Description

This function reads an Actigraph GT1M accelerometer file.

Usage

gt1m.accfile(file, path, fileid, counts.pos = 1,
	tz = "Europe/London", sparse = FALSE,
	fault = 32767)

Arguments

file
file name including file extension.
path
path to file.
fileid
label for file identifier.
counts.pos
when storage mode allows for accelerometer counts and steps to be recorded at the same time, this argument specifies the position of first measurement of accelerometer counts (default is counts.pos = 1).
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).

Value

  • These functions return an object of two classes: accfile and additional device-specific class (i.e., gt1m). An object of class accfile is a list containing the following components:
  • dfA data.frame object with file identifier (fileid), accelerometer counts (counts), accelerometer steps (steps), coded error for counts (error_c) and steps (error_s). See errorCts for error codes. If sparse = TRUE, all variables except fileid of the data frame df are returned as elements of the main list with corresponding names but in sparse matrix format (see as.matrix.csr for details).
  • infoA data.frame object with file identifier (fileid), number of recorded measurements (nobs), epoch (epoch), accelerometer mode (mode), start date and time (ts_start), time zone (tz), battery voltage (voltage), download date and time (ts_dl).
  • error_summaryA list object with file identifier (fileid), summary tables of error codes for counts (counts) and steps (steps), error code for date (date), and logical flag for odd number of measurements (odd_number) (see details).

Details

Raw accelerometer data are processed according to the device data format. Several data checks are performed by errorCts, errorSteps, and infoDate. An additional check is performed on the lenght of the sequence of measurements when both accelerometer counts and steps are recorded. If the length is odd, a warning message is produced. See file 'gt1m_sample.dat' in directory '\inst\extdata' of this package.

References

Actigraph (Pensacola, Florida). 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, gt1m.acclist

Examples

Run this code
data(gt1m_sample)
class(gt1m_sample)

Run the code above in your browser using DataLab