R/import_data.R
import_actigraph_meta.Rd
import_actigraph_meta
imports meta information stored in the Actigraph
summary csv file.
import_actigraph_meta(filepath, header = TRUE)
string. The filepath of the input data.
logical. Whether the Actigraph RAW or summary csv file includes column names. Default is TRUE.
list. A list of Actigraph device meta information.
The returned meta information includes following fields.
sr: Sampling rate in Hz.
fw: Firmware version. For example "1.7.0".
sw: Software version of Actilife. For example "6.13.0".
sn: Serial number of the device.
st: Start time of the data, in POSIXct format.
dt: Download time of the data, in POSIXct format.
at: Type of the device. Could be "MAT","CLE", "MOS" or "TAS", corresponding to different Actigraph devices.
imu: Whether the file is about Actigraph GT9X IMU data.
gr: The dynamic range in \(g\) unit.
vs: The voltage level of the device, may be used in AD conversion. See
import_actigraph_csv
.
res: The resolution or the number of
bits used to store quantized voltage values of the device, may be used in AD
conversion. See import_actigraph_csv
.
This function is a File IO function that is used to get related meta information such as sampling rate, firmware version from Actigraph devices.
Other File I/O functions:
export_to_actilife()
,
import_actigraph_count_csv()
,
import_actigraph_csv_chunked()
,
import_actigraph_csv()
,
import_activpal3_csv()
,
import_enmo_csv()
,
import_mhealth_csv_chunked()
,
import_mhealth_csv()
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]
#> [1] "------------ Data File Created By ActiGraph GT3X+ ActiLife v6.13.3 Firmware v2.5.0 date format M/d/yyyy at 40 Hz Filter Normal -----------"
#> [2] "Serial Number: CLE2B20130009"
#> [3] "Start Time 11:27:00"
#> [4] "Start Date 6/14/2018"
#> [5] "Epoch Period (hh:mm:ss) 00:00:00"
#> [6] "Download Time 15:16:42"
#> [7] "Download Date 6/14/2018"
#> [8] "Current Memory Address: 0"
#> [9] "Current Battery Voltage: 4.21 Mode = 12"
#> [10] "--------------------------------------------------"
#> [11] "Timestamp,Accelerometer X,Accelerometer Y,Accelerometer Z"
#> [12] "6/14/2018 12:08:39.725,-0.009,-0.053,-0.988"
#> [13] "6/14/2018 12:08:39.750,-0.009,-0.053,-0.982"
#> [14] "6/14/2018 12:08:39.775,-0.009,-0.053,-0.988"
#> [15] "6/14/2018 12:08:39.800,-0.009,-0.053,-0.982"
# Load the meta headers of input file
import_actigraph_meta(filepath, header=TRUE)
#> $sr
#> [1] 40
#>
#> $fw
#> [1] "2.5.0"
#>
#> $sw
#> [1] "6.13.3"
#>
#> $sn
#> [1] "CLE2B20130009"
#>
#> $st
#> [1] "2018-06-14 11:27:00.000 UTC"
#>
#> $dt
#> [1] "2018-06-14 15:16:42.000 UTC"
#>
#> $at
#> [1] "CLE"
#>
#> $imu
#> [1] FALSE
#>
#> $gr
#> [1] "6"
#>
#> $vs
#> [1] 4.21
#>
#> $res
#> [1] 12
#>
# Restore default options
options(default_ops)