Auto-updating back to SPT even though sleep log is supplied and option is set to TimeinBed

87 views
Skip to first unread message

Milan Zarchev

unread,
Dec 20, 2021, 8:58:51 AM12/20/21
to R package GGIR
Hi,

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!
sleeplog_formatted.csv
part4_nightsummary_sleep_cleaned.csv
GGIR_sleep_efficiency.R

Vincent van Hees

unread,
Dec 23, 2021, 5:08:14 AM12/23/21
to Milan Zarchev, R package GGIR
Sorry to hear that Milan,
This issue may have been fixed already. Can you try again with the latest development version. To install it, please run the following R commands:

install.packages("remotes")
library(remotes)
remotes::install_github("wadpac/GGIR")

Thanks,
Vincent

Dr. Vincent van Hees | Independent consultant | https://accelting.com/
image


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
--
You received this message because you are subscribed to the Google Groups "R package GGIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to RpackageGGIR...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/RpackageGGIR/65a9c333-f47e-4151-a681-d40d58ed5133n%40googlegroups.com.

Milan Zarchev

unread,
Dec 23, 2021, 5:27:31 AM12/23/21
to R package GGIR
Thank you for the help Vincent, its much appreciated! 

I will report on whether the development version solves this when I have access to my work computer early January.

Milan Zarchev

unread,
Jan 6, 2022, 5:47:37 AM1/6/22
to R package GGIR
Just an update for anyone else that might be encountering a similar issue - Vincent's newest dev version of GGIR solves the issue and I am able to obtain sleep efficiency metrics now with the same code I used before. 

Thank you once again Vincent for your tireless work on developing and assisting with GGIR!

Milan

Reply all
Reply to author
Forward
0 new messages