I'm running into some trouble when trying to calculate the sleep efficiency metric. I have a sleep diary with time in bed data that I am able to read with no errors using the g.loadlog function (see attached script and sleep diary for 20 participants). However, when I supply the same sleep log to the GGIR main function and run the analyses, I get the message:
Auto-updating sleepwindowType to SPT because nog sleeplog used and neither HASPT.algo HorAngle used.
It's weird because obviously the sleep log is not only loaded but also used, as the part4_nigtsummary output shows (sleeplog_used = 1 for all rows). So now I am completely confused as to why I GGIR is switching back to SPT and I do not get sleep efficiency metrics.
Additionally, I am also getting these error messages which could be relevant?
In `[<-.factor`(`*tmp*`, iseq, value = "9.2625") :
invalid factor level, NA generated
The same ones show up however when I am trying to just do the SPT analysis (I have a different diary for sleep time not time in bed) and everything seems in order there despite the errors.
Any help here would be very much appreciated!