parse_sleepwake_sequence.Rd
It is common to have sleep wake history information in the form of a binary sequence. This is the format used by SAFTE-FAST and other proprietary software. Further, this format is often easily exported by actigraphy measurement software.
parse_sleepwake_sequence(seq, epoch, series.start)
A sequence of 0
(sleep) and 1
(wake) integers indicating sleep/wake status at that moment.
Integer expressing length of each observations in the series (minutes).
A POSIXct object indicating the start datetime of the simulation (i.e., pre-first sleep waking duration)
FIPS_df
formatted dataframe
start_date = as.POSIXct("2018-05-01 10:00:00")
bitvector_sequence = rep(rep(c(1,0), 6), sample(20:40, 12))
FIPSdf_from_bitvec = parse_sleepwake_sequence(
seq = bitvector_sequence,
series.start = start_date,
epoch = 15)