Make a sleep matrix (sleep=1 and wake=0) based on the sleep onset and wake up time for the purpose of calculating physical acitivy features during wake up time.
makeSleepDataMatrix(sleepFN, epochOut = 60, impute = TRUE, outputFN)Sleep matrix and messages of sleep data.
Duplicate days of sleep data if exists
Invalid sleep data if exists
write the sleep matrix to a csv file specified by outputFN
charcter The input file name with path of sleep onset and wake up. By default, we use part4_nightsummary_sleep_full.csv under /results/QC folder from GGIR output.
number Epoch size to which acceleration was averaged (seconds) in part 3. Defaut is 60 seconds.
logical Specify if the missing sleep time was imputed based on the averge sleep onset and wake up time. Default is TRUE.
character The output file name that the nonsleep matrix was wrote to. It includs filename, Date, daysleeper, sleeponset, wakeup, oldDate, sleepwindow, sleepimpute, MIN1, MIN2, ..., MIN1440 for the minutes level data when flag.epochOut=60 seconds.