advanced sleep log error

159 views
Skip to first unread message

Joe Winer

unread,
Dec 14, 2024, 12:03:58 AM12/14/24
to R package GGIR
I have an advanced sleep log with 220 rows that kept crashing GGIR with the following error: 

Error in seq.int(0, to0 - from, by) : wrong sign in 'by' argument
Calls: g.shell.GGIR ... <Anonymous> -> g.part4 -> g.loadlog -> seq -> seq.Date

When I ran GGIR without the sleep log it worked fine. After checking the formatting of my log very carefully, my strategy became to iteratively run the log through adding just a few rows at a time and seeing if particular rows were causing the crash. Indeed, there are 3 rows (out of the 220) that when removed, part 4 runs just fine (with 217 sleep log rows intact).

I am satisfied to have gotten GGIR to run with the 217 logs, but stumped as to why these 3 rows crash the software. Does anyone see anything wrong with the attached entries? I may be missing something.

Thanks very much in advance.

Joe Winer

AdvancedLogErrors_2024-12-13.csv

Vincent van Hees

unread,
Dec 18, 2024, 8:27:56 AM12/18/24
to Joe Winer, R package GGIR
Hi Joe,

The GGIR GitHub-only release from last week (3.1-8) may address this. Would you mind trying again with that GGIR version? => remotes::install_github("wadpac/GGIR")

If this does not work, would you mind sharing the corresponding RData file from the meta/basic folder to allow me to reproduce the error?

Note that one of the updates is that it now allows you to skip dates in the diary that have no time entries. I now realise this aspect was not documented yet and will add it to my to do list.
So, recording 3 in your file could start with the timestamps for 27/2/2024.

Thanks,
Vincent
--
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, visit https://groups.google.com/d/msgid/RpackageGGIR/14a53eaf-6689-48b1-966f-93552a2b054an%40googlegroups.com.

Joe Winer

unread,
Dec 18, 2024, 5:48:54 PM12/18/24
to R package GGIR
Thank you Vincent for the response. I've now updated to 3.1-8 and unfortunately I have received the same error. I've uploaded the three RData files with the error-provoking logs here - https://stanfordmedicine.box.com/s/82h5jv6otxpyvdkdkn78dw0tt6lg4g5b

Good to know about the update regarding skipping diary dates, thank you for that. I'd be glad to try anything else that may solve the problem, let me know.

Joe

Vincent van Hees

unread,
Jan 10, 2025, 1:00:11 PMJan 10
to Joe Winer, R package GGIR
Hi Joe,

Your accelerometer and sleeplog date ranges do not overlap.

I have now prepared a fix that ensures that sleeplog is ignored when this happens.
You can test it with: remotes::install_github("wadpac/GGIR")

Vincent

Joe Winer

unread,
Jan 11, 2025, 1:40:38 PMJan 11
to Vincent van Hees, R package GGIR
Thanks very much Vincent for your efforts on this issue.

Unfortunately after installing the new version, I receive a new (different) error when trying to run part 4 with a sleep log sheet:
Error in if (deltadate > 300) { : the condition has length > 1
Calls: GGIR -> g.part4 -> g.loadlog

Does this look like a straightforward issue to you? If not I can repeat my procedure of looking for rows that may have triggered the issue.

Vincent van Hees

unread,
Jan 17, 2025, 3:30:13 AMJan 17
to Joe Winer, R package GGIR
I was able to process your example file with the updated GGIR code. Please confirm that you are able to process the files you were previously not able to process such that we know that that issue has been fixed. 

For new issues, please provide a new reproducible example.

Thanks,
Vincent

Joe Winer

unread,
Jan 17, 2025, 12:43:43 PMJan 17
to R package GGIR
Thank you Vincent. It does seem that this is a new, different error, and I have isolated the logs that are now crashing GGIR. I have uploaded the error logs and the RData files here: https://stanfordmedicine.box.com/s/82h5jv6otxpyvdkdkn78dw0tt6lg4g5b

I hope that working out these log errors are helpful to the community of users and I appreciate your efforts on this.

Joe

Vincent van Hees

unread,
Jan 24, 2025, 4:57:06 AMJan 24
to Joe Winer, R package GGIR
Hi Joe,

I also did get an error, which was in the visual report generation. I have now fixed it and you can test the fix by installing GGIR via:

remotes::install_github("wadpac/GGIR", ref = "issue1257_visualreport_startmidnight")

Next time, please share a copy of the new error as well because it is unclear to me now whether this was the actual error you ran into.

Best,

Vincent

Joe Winer

unread,
Jan 25, 2025, 1:27:12 AMJan 25
to Vincent van Hees, R package GGIR
Thank you Vincent. Apologies for not reposting the error I had received. The initial error I had received when running these six files/logs was:
Error in if (deltadate > 300) { : the condition has length > 1
Calls: GGIR -> g.part4 -> g.loadlog 
 
After installing the new version you sent today, I received the following error:
Error in exists("B") && nnights > 0 :
  'length = 5' in coercion to 'logical(1)'

If part4 is running for these files/logs for you, is there something I can do to avoid this issue?
Thanks again for your efforts on this.

Joe

Vincent van Hees

unread,
Feb 17, 2025, 12:00:14 PMFeb 17
to Joe Winer, R package GGIR
Hi Joe,
This is difficult to investigate for me without being able to reproduce the error.
At least the error message you shared indicates to me that the error is specific to processing the sleep diary.

Can you confirm that you are using the exact same sleep diary you shared with me?
Named AdvancedLogErrors_2024-12-13.csv and with IDs: 79036_0000000203 96844_0000001338 81928_0000000674

Thanks,

Vincent

Joe Winer

unread,
Apr 10, 2025, 3:12:13 PMApr 10
to R package GGIR
Hi Vincent,

Apologies for the delay in responding. I wanted to follow up on the sleep log issues I had been experiencing. This morning I updated to the current version of GGIR and attempted to run part 4 with advanced sleep diaries for ~250 files. There were no errors, and the part 4 output looks great. I appreciate that there are now warnings given for recordings which do not match the dates in the diaries (but that this does not crash the script). 

Many thanks for your hard work on this!!

Joe Winer
Reply all
Reply to author
Forward
0 new messages