makeSleepDataMatrix {mMARCH.AC}R Documentation

Make a sleep matrix based on the sleep onset and wake up time

Description

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.

Usage

makeSleepDataMatrix(sleepFN, epochOut = 60, impute = TRUE, outputFN)

Arguments

sleepFN

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.

epochOut

number Epoch size to which acceleration was averaged (seconds) in part 3. Defaut is 60 seconds.

impute

logical Specify if the missing sleep time was imputed based on the averge sleep onset and wake up time. Default is TRUE.

outputFN

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.

Value

Sleep matrix and messages of sleep data.

duplicatedays

Duplicate days of sleep data if exists

sleepproblem

Invalid sleep data if exists

sleep matrix (0/1)

write the sleep matrix to a csv file specified by outputFN


[Package mMARCH.AC version 2.9.2.0 Index]