Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part 4: Error in if (is.na(defaultGuider)) { : argument is of length zero` #1225

Closed
vincentvanhees opened this issue Nov 15, 2024 · 3 comments · Fixed by #1227
Closed

Part 4: Error in if (is.na(defaultGuider)) { : argument is of length zero` #1225

vincentvanhees opened this issue Nov 15, 2024 · 3 comments · Fixed by #1227
Assignees

Comments

@vincentvanhees
Copy link
Member

Someone reported to me the part 4 error:
1Error in if (is.na(defaultGuider)) { : argument is of length zero
based on default GGIR settings.

I investigated it and see it is triggered by night number 0 to exist in the part 3 output, caused by revisions to function g.det.sib in the past year which made that night number 0 can be left in the data during the DST hour in the spring, which then is confusing for part 4 where night number is defined as the range in values in night number column of the part 3 output.

I am now working on a fix.

@jhmigueles
Copy link
Collaborator

Hi, I have just observed the same and I was investigating this as well. Let me know if you need any help or you want me to double-check anything with another dataset. FYI, I observed this in the DST hour change in the autumn (not spring).

It could be a good opportunity to revise the internal function dstime_handling_check within g.sib.det, I drafted some code for this in the branch "sleep_horAngle".

@vincentvanhees
Copy link
Member Author

vincentvanhees commented Nov 18, 2024

I drafted a solution in https://github.com/wadpac/GGIR/tree/issue1225_DST_part3 and am waiting for Mike to confirm that this fixes the issue for him.

Explanation:
The code in part 3 has been defining the window for sleep detection by default as noon +/- 12 hours which causes that the hour 11am-noon is missed during DST in the autumn (5-11-2023), which causes the hour to be listed with night number 0, and that then caused trouble later on where we define night range as the range in values for night numbers.

@jhmigueles
Copy link
Collaborator

Thanks! I have just tested this and your fix works for me as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants