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.
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 g unit.
Details
For old device (GT3X) that stores accelerometer values as digital voltage. The function will convert the values to g unit using the following equation.
xg=(2r)−2vxvoltager
Where v is the max voltage corresponding to the max accelerometer value that can be found in the meta section in the csv file; r is the resolution level which is the number of bits used to store the voltage values. r 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)