read_gt3x: Read data from a gt3x file

View source: R/read_gt3x.R

read_gt3xR Documentation

Read data from a gt3x file

Description

Read data from a gt3x file

Usage

read_gt3x(
  file,
  tz = "UTC",
  verbose = FALSE,
  include = c("METADATA", "PARAMETERS", "SENSOR_SCHEMA", "BATTERY", "EVENT", "TAG",
    "ACTIVITY", "HEART_RATE_BPM", "HEART_RATE_ANT", "HEART_RATE_BLE", "LUX", "CAPSENSE",
    "EPOCH", "EPOCH2", "EPOCH3", "EPOCH4", "ACTIVITY2", "SENSOR_DATA"),
  flag_idle_sleep = FALSE,
  parser = c("legacy", "dev", "external"),
  cleanup = FALSE,
  data_checks = TRUE,
  ...
)

Arguments

file

character. Path to the file

tz

character. The timezone to use

verbose

logical. Print updates to console?

include

character. The PACKET types to parse

flag_idle_sleep

should recorded idle sleep times be tagged?

parser

the parsing scheme to use, either legacy, dev, or external. The legacy parser runs slowly but includes more extensive checks to ensure alignment with RAW.csv and IMU.csv files. The development parser runs faster and has also been checked for alignment with RAW.csv and IMU.csv files, but not as strictly. For example, rounding is not performed by parser="dev". The external parser is a wrapper for read.gt3x::read.gt3x, and specific arguments can be passed in via ...

cleanup

logical. Delete unzipped files?

data_checks

logical. Run extra checks on the data (e.g. for large values and duplicated timestamps)? Set to FALSE to speed up reading.

...

arguments passed to read.gt3x::read.gt3x when parser == "external"

Details

The default value for include gives all possible packet types, of which there are 18. Processing time can be reduced by passing a subset of the 18 possibilities. Exclusion is not recommended for the PARAMETERS and SENSOR_SCHEMA packets, which also do not take long to process.

Value

A list of processed data, with one element for each of the relevant packet types.

References

https://github.com/actigraph/GT3X-File-Format

Examples


file_3x <- system.file(
  "extdata", "example.gt3x", package = "AGread"
)
AG_3x <- read_gt3x(file_3x)
head(lapply(AG_3x, head))



AGread documentation built on Sept. 13, 2022, 5:06 p.m.