Part 4 error message - GGIR 2.7-1 - GENEActiv accelerometer + sleep log

87 views
Skip to first unread message

Sundos Malaikah

unread,
Aug 18, 2022, 7:14:25 AM8/18/22
to R package GGIR
Hello everyone, 

I've been using GGIR to analyse raw physical activity data from GENEActiv accelerometer and it usually goes well. However, few days ago I got this new error message even though I've analysed some files successfully using the same scrip few weeks ago.

Below, I copied the error message and the script I used.
Any help to fix this issue would be much appreciated, thank you.

---------

Part 4 1Error in if (params_sleep[["relyonguider"]] == TRUE | relyonguider_thisnight == : argument is of length zero

---------

This is the script I'm using:

## Not run:
library(GGIR)
mode= c(1,2,3,4,5)
datadir= "C:/Users/psssmm/Desktop/DELIVER/Data" #Where is the data?
outputdir= "C:/Users/psssmm/Desktop/DELIVER/Output" #Where do you want to store the data?
studyname="DELIVER"
f0 = 1 #file to start with
f1 = 82 #file to end with
GGIR(#-------------------------------
     # General parameters
     #-------------------------------
     mode=mode,
     datadir=datadir,
     outputdir=outputdir,
     studyname=studyname,
     f0=f0,
     f1=f1,
     overwrite = FALSE,
     do.imp=TRUE,
     idloc=2,
     print.filename=TRUE,
     storefolderstructure = FALSE,
     #-------------------------------
     # Part 1 parameters:
     #-------------------------------
     windowsizes = c(5,900,3600), #5 s epoch, 15 min non-wear detection resolution, 60 min non-wear evaluation window
     do.cal=TRUE,
     do.enmo = TRUE, #ENMO physical activity metric
     do.anglez=TRUE, # for sleep analysis
     do.angley=TRUE,
     do.anglex=TRUE,
     chunksize=1,
     printsummary=TRUE,
     #-------------------------------
     # Part 2 parameters:
     #-------------------------------
     strategy = 1, #see tutorial for explanation of strategies
     ndayswindow=7,
     hrs.del.start = 0,
     hrs.del.end = 0,
     maxdur = 10,
     includedaycrit = 16, # min valid hrs per day
     M5L5res = 10,
     winhr = c(c(960/60),c(840/60),c(720/60),c(600/60),c(540/600),c(480/60),c(360/60),c(300/60),c(240/60),c(120/60),c(60/60),c(30/60),c(15/60),c(10/60),c(5/60)),# - this is the most active  16h, 14h, 12h, 10h, 9h, 8 h, 6h, 5h, 4h, 2h, 1h, 30, 15, 10, 5 min for continuous windows
     qM5L5 = c(0.25,0.5,0.75),#to give percentiles for continuous MXLX variables. This is the 25th, 50th, 75th %iles
     iglevels = TRUE,
     qlevels = c(c(480/1440),c(600/1440),c(720/1440),c(840/1440),c(960/1440),c(1080/1440),c(1200/1440),c(1320/1440),c(1380/1440),c(1395/1440),c(1410/1440),c(1420/1440),c(1425/1440),c(1430/1440),c(1435/1440),c(1438/1440),c(1439/1440)), #quantiles to calculate -  this is the most active 16h, 14h, 12h, 10h, 8h, 6h, 4h, 2h, 60, 45, 30, 20, 15, 10, 5, 2, 1 min accumulated across day
     qwindow=c(0,24), #window for calculation of quantiles  
     ilevels = c(seq(0,9,by=1),seq(10,95,by=5),seq(100,975,by=25),seq(1000,2000,by=100),8000), #gives acceleration distribution by increments defined
     mvpathreshold =c(100,250,400), #thresholds for MVPA, total and bouts 1, 5 & 10 min acceleration>threshold for >80% of time d=or Hildebrand moderate (100) and vigorous thresholds (400) and for brisk walking (250)
     boutcriter = c(0.8),
     mvpadur = c(1,5,10),
     bout.metric = 6,
     IVIS.activity.metric = 2,
     cosinor = TRUE,
     epochvalues2csv = TRUE,
     #-------------------------------
     # Part 3 parameters:
     #-------------------------------
     timethreshold= c(5),
     anglethreshold=5,
     ignorenonwear = TRUE,
     #-------------------------------
     # Part 4 parameters:
     #-------------------------------
     excludefirstlast = FALSE,
     includenightcrit = 16,
     loglocation = "C:/Users/psssmm/Desktop/DELIVER/DELIVER_Sleep_Log.csv",
     def.noc.sleep = c(1),
     outliers.only = FALSE,
     criterror = 2,
     relyonsleeplog = FALSE,
     sleeplogidnum = FALSE,
     colid=1,
     coln1=2,
     do.visual = TRUE,
     nnights = 7,
     #-------------------------------
     # Part 5 parameters:
     #-------------------------------
     # Key functions: Merging physical activity with sleep analyses
     threshold.lig = c(30),
     threshold.mod = c(100),
     threshold.vig = c(400),
     boutcriter.in = 0.9,
     boutcriter.lig = 0.8,
     boutcriter.mvpa = 0.8,
     boutdur.in = c(30),
     boutdur.lig = c(10),
     boutdur.mvpa = c(1,5,10),
     timewindow = c("MM","WW"),
     frag.metrics="all",
     part5_agg2_60seconds=TRUE,
     includedaycrit.part5 = 2/3,
     #-----------------------------------
     # Report generation
     #-------------------------------
     do.report=c(2,4,5),
     visualreport=TRUE)
## End(Not run)

Vincent van Hees

unread,
Aug 18, 2022, 11:55:43 AM8/18/22
to Sundos Malaikah, R package GGIR
I have not seen this error before, maybe try:


Cheers,

Vincent

------- 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/057f00ec-fb00-410e-b5ce-b5539e83ff69n%40googlegroups.com.

Sundos Malaikah

unread,
Aug 22, 2022, 8:09:36 AM8/22/22
to R package GGIR
Hello,

I've tried removing the config.csv file but the problem persisted. Running part2 seems to work and yielded part2_summary and part2_daysummary.
I still get the same error messages even after adding these options:
1st attempt: install.packages("GGIR", dependencies = TRUE)
2nd attempti: install.packages("remotes") remotes::install_github("wadpac/GGIR")

The error message is the same: 
Part 4 1Error in if (params_sleep[["relyonguider"]] == TRUE | relyonguider_thisnight == : argument is of length zero

Would appreciate any advice on how to fix this problem. 



Vincent van Hees

unread,
Aug 30, 2022, 11:53:28 AM8/30/22
to Sundos Malaikah, R package GGIR
Running part2 seems to work and yielded part2_summary and part2_daysummary.

​are values plausible and in line with other succesful results?
For example, do results indicate that the accelerometer has been worn for a certain number of days?

Vincent


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

------- Original Message -------
Reply all
Reply to author
Forward
0 new messages