expand_periods: Expand time periods into a data frame of equally spaced time...

View source: R/utils.R

expand_periodsR Documentation

Expand time periods into a data frame of equally spaced time points

Description

Expand time periods into a data frame of equally spaced time points

Usage

expand_periods(periods, start_var, end_var, units = "1 min")

Arguments

periods

A data frame with at least two columns, start_var and end_var which are the first and the last epoch in a set of time periods, e.g. sleep periods or (non)wear periods.

start_var

The variable (unquoted) which indicates when the time periods start.

end_var

The variable (unquoted) which indicates when the time periods end.

units

The time unit as a characters string. The default is "1 min".

Examples

library("dplyr")
data("gtxplus1day")

gtxplus1day %>%
  collapse_epochs(60) %>%
  apply_choi(min_period_len = 45) %>%
  expand_periods(period_start, period_end, units = "30 mins")

dipetkov/actigraph.sleepr documentation built on March 25, 2022, 2:33 a.m.