View source: R/collapse_epochs.R
collapse_epochs | R Documentation |
Collapse post-filtered activity counts into larger epoch "buckets".
collapse_epochs(agdb, epoch_len_out, use_incomplete = TRUE)
agdb |
A |
epoch_len_out |
Output (longer) epoch length in seconds, must be
exact multiple of the input epoch length. Currently only
|
use_incomplete |
logical. Set to |
Activity counts cannot be reintegrated into shorter epochs, e.g.,
60s -> 10s. Currently, collapse_epochs()
integrates into 60s
epochs only. This is not general but is sufficient for sleep
analysis because the standard Sadeh and Cole-Kripke sleep algorithms
were developed for 60s epoch data.
Suppose we want to collapse from 15 to 60 seconds. A complete 60s epoch consists of four 15s epochs: 00, 15, 45 and 60. However, the first and last epochs would be incomplete if the device started/stopped collecting data mid-minute. ActiLife 6 uses these epochs anyway. For example, if only 45 and 60 are available for the first minute, then ActiLife will aggregate across these two epochs only. This is a reasonable approach to sleep analysis with the Sadeh and the Cole-Kripke algorithms which pad the beginning and the end of the time series with zeros anyway.
A tibble
of activity data collapsed into one-minute epochs.
ActiLife 6 User's Manual by the ActiGraph Software Department. 04/03/2012.
library("dplyr") data("gtxplus1day") gtxplus1day %>% collapse_epochs(60)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.