import_actigraph_csv function

Import raw multi-channel accelerometer data stored in Actigraph raw csv format

Import raw multi-channel accelerometer data stored in Actigraph raw csv format

import_actigraph_csv imports the raw multi-channel accelerometer data stored in Actigraph raw csv format. It supports files from the following devices: GT3X, GT3X+, GT3X+BT, GT9X, and GT9X-IMU.

import_actigraph_csv( filepath, in_voltage = FALSE, has_ts = TRUE, header = TRUE )

Arguments

  • filepath: string. The filepath of the input data. The first column of the input data should always include timestamps.
  • in_voltage: set as TRUE only when the input Actigraph csv file is in analog quantized format and need to be converted into g value
  • has_ts: boolean. If TRUE, the input csv file will have a timestamp column.
  • header: boolean. If TRUE, the input csv file will have column names in the first row.

Returns

dataframe. The imported multi-channel accelerometer signal, with the first column being the timestamps in POSXlct format, and the rest columns being accelerometer values in gg unit.

Details

For old device (GT3X) that stores accelerometer values as digital voltage. The function will convert the values to gg unit using the following equation.

xg=xvoltager(2r)v2 x_g = \frac{x_{voltage}r}{(2 ^ r) - \frac{v}{2}}

Where vv is the max voltage corresponding to the max accelerometer value that can be found in the meta section in the csv file; rr is the resolution level which is the number of bits used to store the voltage values. rr can also be found in the meta section in the csv file.

How is it used in MIMS-unit algorithm?

This function is a File IO function that is used to import data from Actigraph devices during algorithm validation.

Examples

default_ops = options() options(digits.secs=3) # Use the sample actigraph csv file provided by the package filepath = system.file('extdata', 'actigraph_timestamped.csv', package='MIMSunit') # Check file format readLines(filepath)[1:15] # Load the file with timestamp column df = import_actigraph_csv(filepath) # Check loaded file head(df) # Check more summary(df) # Use the sample actigraph csv file without timestamp filepath = system.file('extdata', 'actigraph_no_timestamp.csv', package='MIMSunit') # Check file format readLines(filepath)[1:15] # Load the file without timestamp column df = import_actigraph_csv(filepath, has_ts = FALSE) # Check loaded file head(df) # Check more summary(df) # Restore default options options(default_ops)

See Also

Other File I/O functions: export_to_actilife(), import_actigraph_count_csv(), import_actigraph_csv_chunked(), import_actigraph_meta(), import_activpal3_csv(), import_enmo_csv(), import_mhealth_csv_chunked(), import_mhealth_csv()