global.activity.summaries: Calculate Common Activity Summaries from Summarised Data

View source: R/global_activity_summaries.R

global.activity.summariesR Documentation

Calculate Common Activity Summaries from Summarised Data

Description

Takes a data frame with activity measurements (MAD), and time. Returns a data frame with one row with relevant global activity summaries. This function was validated against 'arctools::activity_stats'.

Usage

global.activity.summaries(
  data,
  epoch.seconds = 60,
  inactive = 9.041,
  vlight = 28.187,
  light = 58.083,
  frag.start = 10,
  frag.stop = 18
)

Arguments

data

A data frame with epoch-level activity summaries. This function is designed to input the data frame returned from postuR::process.zacl directly. If not, variables should include time (class dttm), mad (mean amplitude deviation), wear (indicator for whether the device was actually worn during a given period), and time.group (a count variable indicating the distinct wear bout).

epoch.seconds

How many seconds does each row in the "data" argument correspond to?

inactive

Upper bound activity intensity cutpoint for inactivity category from mean absolute deviation (milli-gravitational units).

vlight

Upper bound activity intensity cutpoint for very light activity category from mean absolute deviation (milli-gravitational units).

light

Upper bound activity intensity cutpoint for light activity category from mean absolute deviation (milli-gravitational units).

frag.start

Hour of the day at which to start calculating fragmentation measures. Use 0 for 24 hours.

frag.stop

Hour of the day at which to stop calculating fragmentation measures. Use 24 for 24 hours.

Value

data frame with the following variables

- start: time of starting epoch

- end: time of last epoch

- epoch.seconds: duration of epoch-level summaries (same as input)

- days: duration of recording time in days

- wear.days: duration of wear time in days (should be less than days)

- wear.bout.count: number of wear bouts in the case of intermittant non-wear

- mad_0...mad_22: average mean absolute deviation of acceleration in two hour bins throughout the day.

- mad: daily average mean absolute deviation

- down: daily hours of time spent lying down

- sst: daily hours of time spent sleep or sedentary (mad <= inactive)

- lipa: daily hours of time spent in light physical activity (inactive < mad <= light)

- mvpa: daily hours of time spent in moderate-to-vigorous physical activity (light < mad)


etzkorn/postuR documentation built on Nov. 15, 2024, 12:41 a.m.