ggir_process: Run GGIR Processing

View source: R/ggir_process.R

ggir_processR Documentation

Run GGIR Processing

Description

Run GGIR Processing

Usage

ggir_process(df, unit = "1 min", calibrate = TRUE, verbose = TRUE, ...)

Arguments

df

An object with columns 'X', 'Y', and 'Z' or an object of class 'AccData'

unit

length of time to calculate measures over. a character string specifying a time unit or a multiple of a unit to be rounded to. Valid base units are 'second', 'minute', 'hour', 'day', 'week', 'month', 'bimonth', 'quarter', 'season', 'halfyear', and 'year'. Arbitrary unique English abbreviations as in the period constructor are allowed.

calibrate

Run calibration, passed to do.calibrate in GGIR

verbose

print diagnostic messages

...

additional arguments to pass to g.shell.GGIR

Value

A list with all the output elements

Examples

## Not run: 
files = read.gt3x::gt3x_datapath(2)
path = files[1]
res = read_actigraphy(path)
res = fix_zeros(res)
out = ggir_process(res, desiredtz = "UTC")
sum_data = out$part2$IMP$metashort
m = calculate_mad(res)
m[-(1:10), c("HEADER_TIME_STAMP", "ENMO_t")]
head(sum_data, 20)
sum_data$HEADER_TIME_STAMP = lubridate::as_datetime(sum_data$timestamp)
sum_data = dplyr::left_join(sum_data, m)
cor(sum_data$ENMO, sum_data$ENMO_t)

## End(Not run)

muschellij2/SummarizedActigraphy documentation built on April 9, 2024, 8:32 a.m.