Convert a sleep guider to epoch-level sleep/wake labels
Source:R/acti_sleep_guiders.R
acti_sleep_label.RdA guider defines the likely main sleep window; it is not a sleep/wake
classifier itself. This function applies GGIR's final overlap step to a
sustained-inactivity-bout (sib) classification. With the default
"SPT" rule, an entire SIB is sleep when any part overlaps the guider. With
"TimeInBed", an SIB must be wholly inside the guider.
Usage
acti_sleep_label(sib, guider, sleepwindow_type = c("SPT", "TimeInBed"))Examples
data <- actimetrics::acti_count_data
data <- data[rep(seq_len(nrow(data)), length.out = 24 * 60), ]
data$time <- data$time[1] + (seq_len(nrow(data)) - 1) * 60
guider <- acti_sleep_l5(data)
sib <- data$counts == 0
sleep <- acti_sleep_label(sib, guider)