ag_feature_calc: Custom function to compute features of raw accelerometer...

View source: R/ag_feature_calc.R

ag_feature_calcR Documentation

Custom function to compute features of raw accelerometer data. Can be applied to fixed- or variable-windows (epochs vs sojourns, respectively).

Description

Custom function to compute features of raw accelerometer data. Can be applied to fixed- or variable-windows (epochs vs sojourns, respectively).

Usage

ag_feature_calc(
  ag_data_raw_wrist,
  participant,
  samp_freq = 80,
  window = 15,
  soj_colname = NA,
  seconds_colname = NA,
  inactive_threshold = 0.1
)

Arguments

ag_data_raw_wrist

Raw accelerometer data containing AxisX, AxisY, AxisZ, and VM data columns

participant

Character string for participant ID

samp_freq

Sampling frequency of the raw accelerometer data. Defaults to 80 Hz

window

Epoch window (in seconds). Can be either a fixed number or 'sojourn' character string. If 'sojourn', a column of sojourn indices is expected to be present in the data.

soj_colname

Character string for column name containing the sojourn indices

seconds_colname

Character string for column name containing the duration of a given sojourn Library dependencies: tidyverse, lubridate, data.table


robmarcotte/MOCAfunctions documentation built on March 23, 2024, 12:33 p.m.