#create a sample dataset
sample <- tibble::tibble(Datetime = c("2023-08-15 6:00:00",
"2023-08-15 23:00:00",
"2023-08-16 6:00:00",
"2023-08-16 22:00:00",
"2023-08-17 6:30:00",
"2023-08-18 1:00:00"),
State = rep(c("wake", "sleep"), 3),
Id = "Participant")
#intervals from sample
sc2interval(sample)
#recoded intervals
sc2interval(sample) %>% sleep_int2Brown()
Run the code above in your browser using DataLab