Baseline Package for Reading Actigraphy and Activity Data

Provides baseline functions for reading actigraphy and activity data, relying on baseline functions from 'actibase'. Reads data from 'Axivity' 'CWA' < https://axivity.com/> , ActiGraph 'GT3X' < https://ametris.com/actigraph-wgt3x-bt>, 'SensorLog' < https://sensorlog.berndthomas.net/>, and 'SensorLogger' < https://www.tszheichoi.com/sensorlogger> zipped CSV files.


R-CMD-check Codecov testcoverage

actiread Package

actiread reads raw actigraphy files and returns tidy data frames that are ready for downstream analysis.

It currently focuses on:

  • reading gt3x files
  • reading cwa files
  • Reading SensorLog files
  • Reading SensorLogger files
  • loading small example files bundled with the package
  • inspecting GT3X header metadata
  • handling timezone conversion during import

Installation

You can install actiread from GitHub with:

# install.packages("remotes")
remotes::install_github("jhuwit/actiread")

Quick start

library(actibase)
library(actiread)

gt3x_file = acti_example_gt3x()
cwa_file = acti_example_cwa()

gt3x = acti_read_gt3x(gt3x_file, verbose = FALSE)
cwa = acti_read_cwa(cwa_file, verbose = FALSE)

head(gt3x)
#> # A tibble: 6 × 4
#>   time                    X      Y     Z
#>   <dttm>              <dbl>  <dbl> <dbl>
#> 1 2019-09-17 22:40:00 0      0.008 0.996
#> 2 2019-09-17 22:40:00 0.016  0     1.01 
#> 3 2019-09-17 22:40:00 0.02  -0.008 1.00 
#> 4 2019-09-17 22:40:00 0.016 -0.012 1.01 
#> 5 2019-09-17 22:40:00 0.016 -0.008 1.01 
#> 6 2019-09-17 22:40:00 0.008 -0.008 1.01
head(cwa)
#> # A tibble: 6 × 7
#>   time                    x      y      z  temp battery light
#>   <dttm>              <dbl>  <dbl>  <dbl> <dbl>   <dbl> <dbl>
#> 1 2019-02-26 10:55:06 0.328  0.984  0.203  25.6       0   283
#> 2 2019-02-26 10:55:06 0.822 -0.343 -0.368  25.6       0   283
#> 3 2019-02-26 10:55:06 0.874 -0.390 -0.390  25.6       0   283
#> 4 2019-02-26 10:55:06 0.890 -0.391 -0.391  25.6       0   283
#> 5 2019-02-26 10:55:06 0.891 -0.376 -0.391  25.6       0   283
#> 6 2019-02-26 10:55:06 0.876 -0.360 -0.376  25.6       0   283

res = acti_standardize_data(gt3x)
resampled = acti_resample(res, sample_rate = 30L)
get_transformations(resampled)
#> [1] "acti_resample:sample_rate_attribute_changed_to_30"
#> [2] "acti_resample:linear_resampled_to_30Hz"           
#> [3] "acti_read_gt3x:timezone_GMT_forced"               
#> [4] "acti_read_gt3x:timezone_Etc/GMT-4_applied"        
#> [5] "acti_read_gt3x:attributes_set"                    
#> [6] "acti_fill_zeros:filled_zeros"                     
#> [7] "acti_read_gt3x:data_read"
tzoffset_to_tz(c("+00:00", "-05:00", "+01:00"))
#> [1] "Etc/GMT0"  "Etc/GMT-5" "Etc/GMT+1"

What you can do

actiread is a focused import layer for actigraphy data:

  • read .gt3x/.gt3x.gz files with acti_read_gt3x()
  • read .cwa/.cwa.gz files with acti_read_cwa()
  • inspect GT3X metadata with acti_info_gt3x()
  • use bundled sample files with acti_example_gt3x() and acti_example_cwa()
  • control timezone handling during import with tz and apply_tz

The readers return tidy objects with attached metadata such as the file header and sampling rate, which makes it straightforward to hand the result off to your own cleaning, summarization, or modeling code.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("actiread")

0.5.0 by John Muschelli, 2 months ago


https://jhuwit.github.io/actiread/


Report a bug at https://github.com/jhuwit/actiread/issues


Browse source code at https://github.com/cran/actiread


Authors: John Muschelli [aut, cre] (ORCID:


Documentation:   PDF Manual  


GPL-3 license


Imports actibase, GGIRread, read.gt3x, R.utils, magrittr, dplyr, lubridate, assertthat, cli, tibble, janitor, purrr, readr, methods

Suggests testthat, utils, covr, knitr, rmarkdown, reticulate, arrow


Imported by actimetrics, actisensorlog.


See at CRAN