Error when trying to use backup.cal.coef: Error in filesummary[vi + 1] <- C$QCmessage : replacement has length zero

26 views
Skip to first unread message

joeck...@gmail.com

unread,
Apr 20, 2025, 11:31:32 PMApr 20
to R package GGIR
Dear GGIR community, 

I have 3 GeneActiv accelerometer files, all from the same accelerometer, that failed to calibrate with calib_status = "recalibration not done because not enough points on all sides of the sphere". As recommended in the book, I then used parameter backup.cal.coef to specify calibration coefficients from an accelerometer run from the same accelerometer where there was no calibration error (I have 2 such files to try with where the same watch calibrated fine). 

However, no matter what I try, I keep getting the error: "Error in filesummary[vi + 1] <- C$QCmessage : replacement has length zero" in Part 2, and I am unsure what this means or how to fix it. I don't believe that any of the files have too much non-wear time, as their plots_to_check_data_quality from the original run show plenty wear time with regular temperature oscillations, just nothing for the acceleration values (see screenshot below for example). 

I have attached the csv for the calibration coefficients that I used, as well as my GGIR code. I have also tried setting row.names to false when creating the csv, in case the setup of the csv is wrong, but I receive the same error. I am getting the above error for no matter which of the 2 possible backup calibration coefficient csvs I use, or which of the 3 failed files I try them on. This makes me think there is something wrong with my set up. If anyone is familiar with this error or has successfully used backup.cal.coef when calibration fails and is willing to share their code/insights, that would be a great help.

R version 4.4.2 (2024-10-31)
GGIR version 3.1-5

Thank you for your time!
Joanna


Screenshot 2025-04-20 at 8.23.55 PM.png
calibration_error.R
calibration_coefficients.csv

Vincent van Hees

unread,
May 1, 2025, 10:30:16 AMMay 1
to joeck...@gmail.com, R package GGIR
Dear Joanna,

Your approach to the problem sounds correct. I see GGIR matches the coefficients by looking up the filename. Can you try changing 
"VR0230_right wrist_054520_2024-05-31 15-27-36.bin" in your csv file to be the new file name (the one with the problems).

Please let me know if this solves the problem. Also if you could double check whether documentation needs to be updated that would be good to know.

If back-up coefficients and GGIR attempts to use them you should first see in your R console:
"Retrieving previously derived calibration coefficients"

If it succeeds you should see in the console that GGIR continuous with extracting signal features, with message:
"Extract signal features (metrics) with the g.getmeta function:"

If extracting back-up coefficients somehow fail you should see a new line:
"Investigate calibration of the sensors with function g.calibrate:"
which is expected to give the same error as you had before.

If the above does not address the issue:
  • Please share the exact console output you get and not only the error message.
  • If possible, share with me (does not have to be public in this group) the actual problematic .bin file.
  • If your research group is in a position to financially contribute to my time to tidy up this old GGIR functionality and corresponding documentation in new GGIR release then that would be much appreciated. For example, I image it would be more logical if the match was done based on device serial number, but that would then first have to be stored in the output.

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/4dcdeeb8-efac-44c0-ada4-979045471d28n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages