import_activpal3_csv: Import raw multi-channel accelerometer data stored in...

View source: R/import_data.R

import_activpal3_csvR Documentation

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

Description

import_activpal3_csv imports the raw multi-channel accelerometer data stored in ActivPal3 csv format by converting the accelerometer values (in digital voltage values) to g unit.

Usage

import_activpal3_csv(filepath, header = FALSE)

Arguments

filepath

string. The filepath of the input data.

header

boolean. If TRUE, the input csv file will have column names in the first row.

Details

ActivPal 3 sensors have known dynamic range to be (-2g, +2g). And the sensor stores values using 8-bit memory storage. So, the digital voltage values may be converted to g unit using following equation.

x_g = \frac{x_{voltage} - 127}{2^8} * 4

Value

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.

How is it used in MIMS-unit algorithm?

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

See Also

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

Examples

  default_ops = options()
  options(digits.secs=3)
  # Use the sample activpal3 csv file provided by the package
  filepath = system.file('extdata', 'activpal3.csv', package='MIMSunit')

  # Check the csv format
  readLines(filepath)[1:5]

  # Load the file, in our case without header
  df = import_activpal3_csv(filepath, header=FALSE)

  # Check loaded file
  head(df)

  # Check more
  summary(df)

  # Restore default options
  options(default_ops)

MIMSunit documentation built on June 21, 2022, 5:06 p.m.