Part 3 error

121 views
Skip to first unread message

Jae In Oh

unread,
Aug 29, 2023, 10:27:12 AM8/29/23
to R package GGIR
Dear GGIR developers and users,

First of all, thank you developers for developing GGIR package so that users like me can analyze accelerometer data much more easily.

I am new to GGIR package and just tried processing accelerometer data with GGIR recently. But I encountered the error that says

Part 3
Error in if (first4am < firstmidnighti) { :
missing value where TRUE/FALSE needed

The accelerometer data I used was in csv format and the columns and rows are shown as the attached image. Also, I used the R code written as below to process the data.

Please note that P11 indicates data of the participant number 11.

GGIR(datadir = "C:/Users/joh22/Downloads/joh22/KOMPAN/HABITUS_package/Test_data/P11",
     outputdir = "C:/Users/joh22/Downloads/joh22/KOMPAN/HABITUS_package/output",
     dataFormat = "actigraph_csv",
     mode = 1:5,
     overwrite = FALSE,
     do.report = c(2, 4, 5),
     windowsizes = c(1, 900, 3600),
     threshold.in = AccThresholds[1],
     threshold.mod = AccThresholds[2],
     threshold.vig = AccThresholds[3],
     includedaycrit = 10,
     includenightcrit = 10,
     acc.metric = "NeishabouriCount_x",
     HASPT.algo = "NotWorn",
     HASIB.algo = "NotWorn",
     boutdur.mvpa = 10, # note that this can be a vector
     boutdur.in = 30, # note that this can be a vector
     boutdur.lig = 10, # note that this can be a vector
     extEpochData_timeformat =  "%m/%d/%Y %H:%M:%S",
     do.neishabouricounts = TRUE,
     do.visual = TRUE,
     visualreport = FALSE,
     outliers.only = FALSE,
     save_ms5rawlevels = TRUE,
     ignorenonwear = FALSE,
     HASPT.ignore.invalid = FALSE,
     save_ms5raw_without_invalid = FALSE)

I will greatly appreciate if anyone can help me solving this issue.
Thank you.

Sincerely,
Jae

P11_ACL_May6 screenshot.JPG

Vincent van Hees

unread,
Aug 29, 2023, 11:45:17 AM8/29/23
to Jae In Oh, R package GGIR
Hi Jae,

Could it be that your recording is short and does not overlap with a midnight?

Sleep detection is not possible in GGIR for a recording that does not span midnight.

I am guessing now that you are the person in the US, that Line and Jasper told me about  earlier this week... in that case we may need to discuss how important it is to process recordings that last only a few hours during day time. If they are then I can have a look at modifying the GGIR to handle the issue (if project budget allows). For now the assumption is that there is at least a couple of days of data spanning two or preferably 3 midnights.

Best,

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/c6491a04-f2ff-44c5-9480-85db1ebcc90fn%40googlegroups.com.

Jae In Oh

unread,
Sep 6, 2023, 1:32:32 PM9/6/23
to R package GGIR
I am sorry Vincent that I replied via email.

Thank you for your prompt response.

As you mentioned, I think our data does not span midnight and I believe that causes the error.
For now, we are mostly interested in processing accelerometer data without sleep detection.

Based on the codes that I shared, I am wondering whether it is possible to run the code if I remove codes that are related to sleep detection. If this is possible, could you specify which codes need to be removed?

Thank you for your help and support, Vincent.

Sincerely,
Jae

Vincent van Hees

unread,
Sep 22, 2023, 2:16:57 PM9/22/23
to Jae In Oh, R package GGIR
Hi Jae,

This is not possible at the moment as GGIR was designed based on the understanding that physical activity researchers never consider a single day without a night as an acceptable measurement duration.

To meet your need we would have to develop a custom R script that partially runs GGIR and partially skips some of the GGIR logic.

However, this will be quite a bit of work. For now (upcoming 1 or 2 weeks) I am focussed on making sure Line can run the tools I developed for her and Jasper on the kind of datasets we have been aiming for. Once that works we can expand to also your use-case.

Best,
Vincent

------- Original Message -------

Jae In Oh

unread,
Sep 22, 2023, 3:05:54 PM9/22/23
to R package GGIR
Dear Vincent,

Thank you for the update. I totally understand that it takes time to handle this issue.
It would be great if you can give another update when we can discuss this matter further.

Thank you and have a great weekend.

Sincerely,
Jae
Reply all
Reply to author
Forward
0 new messages