Learn R Programming

GGIR (version 2.7-1)

read.gt3x_ggir: Read GT3X

Description

Read activity samples from a GT3X file as a matrix. Please note that all timestamps are in local time (of the device) even though they are represented as POSIXct with GMT timezone.

The code in this function is a modified version of the read.gt3x in that it aids batch-loading of modern gt3x files. A pull request has been made to feed these enhancements back into the original code base https://github.com/THLfi/read.gt3x/pull/40. If and when merged we intend to deprecate the GGIR version of the code and make a direct dependency.

Usage

read.gt3x_ggir(
  path,
  verbose = FALSE,
  asDataFrame = FALSE,
  imputeZeroes = FALSE,
  flag_idle_sleep = FALSE,
  cleanup = FALSE,
  ...,
  add_light = FALSE
)

Value

A numeric matrix with 3 columns (X, Y, Z) and the following attributes:

  • start_time : Start time from info file in POSIXct format.

  • subject_name : Subject name from info file

  • time_zone : Time zone from info file

  • missingness : Named integer vector. Names are POSIXct timestamps and values are the number of missing values.

Arguments

path

Path to gt3x folder

verbose

print diagnostic messages

asDataFrame

convert to an activity_df, see as.data.frame.activity

imputeZeroes

Impute zeros in case there are missingness? Default is FALSE, in which case the time series will be incomplete in case there is missingness.

flag_idle_sleep

flag idle sleep mode. If imputeZeroes = TRUE, this finds where all 3 axes are zero.

cleanup

should any unzipped files be deleted?

...

additional arguments to pass to parseGT3X C++ code

add_light

add light data to the data.frame if data exists in the GT3X