--- title: "Research accelerometers: ActiGraph and Axivity" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Research accelerometers: ActiGraph and Axivity} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set(collapse = TRUE, comment = "#>", eval = FALSE) ``` ```{r setup, eval = TRUE} library(PhysioDevices) ``` `readGT3X()` and `readCWA()` read the two field-standard raw research accelerometers -- **ActiGraph** (`.gt3x`, common in US cohorts) and **Axivity AX3/AX6** (`.cwa`, used by UK Biobank and other large studies) -- into the same tri-axial-acceleration `PhysioExperiment` that `PhysioWearable::readAccelCSV()` produces, so they flow straight into the free-living pipeline. The binary decode is delegated to the validated `read.gt3x` and `GGIRread` packages (install them first); the readers only adapt the result. ```{r read} pe <- readGT3X("subject.gt3x") # or readCWA("subject.cwa") pe # a PhysioExperiment: acceleration (x/y/z, g) samplingRate(pe) ``` ## Free-living metrics The acceleration assay feeds ENMO, non-wear/calibration, intensity and the free-living summary exactly as for `readAccelCSV()` output: ```{r freeliving} acc <- SummarizedExperiment::assay(pe, "acceleration") enmo <- PhysioWearable::computeENMO(acc, sampling_rate = samplingRate(pe)) PhysioWearable::summarizeFreeLiving(enmo) # wear time, MVPA, intensity gradient, ... ``` ## Notes - `read.gt3x` / `GGIRread` are `Suggests` -- each reader errors with an install hint if its package is missing. - `readCWA()` reads the whole file by default; pass `start`/`end` (block range) to read a long recording in pieces. - These devices record **raw acceleration only** (no HR/SpO2); pair them with a smartwatch reader for those signals.