R/events.R
normalize_cycles.RdNormalize sleep cycles scored on Noxturnal software from start and stop flags to unique events.
normalize_cycles(events)Events dataframe. Dataframe must have begin (POSIXt), end (POSIXt) and event. Cycles flags must be named Activity-CLASSICstart, Activity-BNstart, Activity-BNend, Activity-REMstart, Activity-REMend, Activity-ENstart or Activity-ENend.
cycles <- data.frame(event = c("Activity-CLASSICstart","Activity-CLASSICend"))
cycles$begin <- as.POSIXct(c("2016-01-16 01:13:30","2016-01-16 01:15:30"))
cycles$end <- as.POSIXct(c("2016-01-16 01:13:30","2016-01-16 01:15:30"))
normalize_cycles(cycles)
#> begin end event
#> 1 2016-01-16 01:13:30 2016-01-16 01:15:30 cycle-CLASSIC