Have issues in generating file summary reports

124 views
Skip to first unread message

Julia ZZ

unread,
Jul 10, 2024, 10:38:39 AM7/10/24
to R package GGIR
Hi all,

I am using GGIRversion 3.1.1 to process my files. However, among 117 files, I only get about 10 file summary reports. I can't fix it. Are there anyone familiar with this issue and able to help me with it? I put the error and warning messages, and codes below. Thank you very much.

Error in 1:max(summarysleep_tmp$night) :
  result would be too long a vector
In addition: Warning messages:
1: In max(summarysleep_tmp$night) :
  no non-missing arguments to max; returning -Inf

Following is my code:
packageVersion("GGIR")
library(GGIR)
datadir="D:.../ACC_all"
outputdir="D:.../GGIR_output_kid_311version_acc_nolog_2023"

g.shell.GGIR(
  mode=c(1:5),
  datadir=datadir,
  outputdir=outputdir,
  studyname="Attempt1",
  idloc=6,
  f0=1,
  f1=117,
  print.filename=FALSE,
  storefolderstructure = FALSE,
  do.parallel=TRUE,
  overwrite=TRUE,
  nonwear_approach="2023",
 
#part 1#
        windowsizes = c(5,900,3600),
        do.anglez=TRUE,
        chunksize = c(1),
        printsummary=TRUE,
 
#part 2#
        strategy = 2 , # this strategy gets rid of first data before first midnight and last midnight
        includedaycrit = 16, M5L5res = 10, #already in default
        winhr = 5,
        qwindow=c(0,24),
        qwindow_dateformat = "%d/%m/%Y",
        qlevels = c(c(1380/1440),c(1410/1440)),
        ilevels = c(0,36, 201, 707, 8000),
        mvpathreshold = c(201),
        boutcriter = 0.8,
        epochvalues2csv=TRUE,
        mvpadur=c(1,5,10),
        iglevels = TRUE, #this function calculates intensity gradient
        #do.parallel = TRUE,

#part3#
        timethreshold= c(5),
        acc.metric="ENMO",
        anglethreshold=5,
        ignorenonwear = TRUE,

#part4#
        def.noc.sleep=1,
        includenightcrit = 4,
        outliers.only = TRUE,
        relyonguider = FALSE,
      criterror = 4,
        do.visual = FALSE,
        nnights = 30,
       
#part 5#
        threshold.lig = c(35.6),
        threshold.mod = c(201.4),
        threshold.vig = c(707.0),
      #Hildebrand 2014 and 2016 intensity thresholds#
        excludefirstlast = FALSE,
        boutcriter = 0.8,
        boutcriter.in = 0.9,
        boutcriter.lig = 0.8,
        boutcriter.mvpa = 0.8,
        boutdur.in = c(10),
        boutdur.lig = c(1),
        boutdur.mvpa = c(1),
        timewindow = c("WW"),
        segmentDAYSPTcrit.part5=c(0, 0.9),
       
do.report=c(2,4,5),
dofirstpage=TRUE,
visualreport=TRUE,
viewingwindow=1)

options(nwarnings = 10000)
warnings()


Vincent van Hees

unread,
Jul 19, 2024, 12:40:08 PM7/19/24
to Julia ZZ, R package GGIR
Hi Julia,

I thought I had fixed this error recently, maybe try with GGIR 3.1-2 and reprocessing part 5 and visualreport?

On separate note - I am hoping to add an alternative visual report later this year as the existing one is just too problematic:
  • It was originally written as a quick visualisation of part 1-4 output to show to study participants, and not intended to be an accurate reflection of part 5 analyses.
  • The code is a mess and almost impossible to work with.
  • It fails to show all the information we generate in part 5

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 on the web, visit https://groups.google.com/d/msgid/RpackageGGIR/f06923e6-87e9-4a1c-a19e-1f1611c4ea55n%40googlegroups.com.

Julia ZZ

unread,
Jul 26, 2024, 2:38:46 PM7/26/24
to R package GGIR
Hi Vincent,

Updating to 3.1.2 did help us get the visual report. Thank you very much for your help, and I look forward to the upcoming new visual report this year.

Julia

Benedict Warner

unread,
Apr 25, 2025, 5:43:01 AMApr 25
to R package GGIR
Hi,

I am replying to this thread because I have the same error and want to check if it is to do with the visual report or if there is something else I am missing.

I have processed 229 CWA files (from Axivity AX3 devices, configured via omGUI to record for 7 days continuously at 100Hz, range +/-8g). However, many of our participants are not wearing the accelerometers at night (this is an issue which I am trying to address!).

Of these, all 229 appear in the part2_summary, only 187 appear in part4_summary_sleep_cleaned, and 198 appear in part5_personsummary_MM_L40M100V. I think I understand why more are in part 5 (because I need 16 valid hours in 24 hours to run part 4, but only 2/3 of the waking day for part 5, so if they do not wear at night we can still do part 5). There are visual reports for 213 of them, and old reports for 32 of them. 

The errors I get in the console output are: 

Error in 1:max(summarysleep_tmp$night) :
  result would be too long a vector
In addition: Warning messages:
1: Both part6CR and part6HCA are set to FALSE by which there is not analysis to be run in part 6.
2: Both part6CR and part6HCA are set to FALSE by which there is not analysis to be run in part 6.
3: Both part6CR and part6HCA are set to FALSE by which there is not analysis to be run in part 6.
4: In g.plot5(metadatadir = metadatadir, dofirstpage = params_output[["dofirstpage"]],  :
 
Visual report not generated for 87178_0000020603.cwa because part 4 output was not available.
5: In g.plot5(metadatadir = metadatadir, dofirstpage = params_output[["dofirstpage"]],  :
 
Visual report not generated for 87178_0000020694.cwa because part 4 output was not available.
6: In g.plot5(metadatadir = metadatadir, dofirstpage = params_output[["dofirstpage"]],  :
 
Visual report not generated for 88786_0000020707.cwa because part 4 output was not available.
7: In max(summarysleep_tmp$night) :

  no non-missing arguments to max; returning -Inf


My questions are:
1) What do the 'Error in 1:max(summarysleep_tmp$night) :   result would be too long a vector' and '7: In max(summarysleep_tmp$night) :  no non-missing arguments to max; returning -Inf' refer to? Are these related to the visual reports?
2) Why does it give warnings for 4 of the files not generating reports, and yet 16 do not have (new) visual reports? 
3) Why are there visual reports for 213 of them, when only 187 have part 4?

I am not that concerned about having the visual reports, but what I am more worried about is me not understanding the process or the error warnings!

Many thanks,
Ben

For reference, I am using GGIR version 3.2.0 in R version 4.4.3 on macOS Sequoia 15.4.1. Here is my configuration:
library(GGIR)
GGIR(datadir="/Users/benedict/Downloads/BDM/CWA files/Data",
     outputdir="/Users/benedict/Downloads/BDM/CWA files/Results",
     mode = c(1,2,3,4,5),
     studyname = "BDMIM",
     idloc=1,
     overwrite=TRUE,
     do.parallel=TRUE,
     windowsizes=c(5,900,3600),
     strategy=1,
     qlevels = c(1/3, #M1/3rd of the day
                0.5, #Median
                (24-2)/24, #M120
                (24-1)/24, #M60
                (24-0.5)/24, #M30
                (24-0.25)/24, #M15
                1395/1400 #M5 - these are all in the 'part 2' output
     ),
     ilevels = c(0,40,100,400),
     iglevels = 1,
     mvpathreshold = c(40,100,400), #these are really LPA, MVPA, and VPA thresholds, but this will tell you time above each
     def.noc.sleep=1,
     HASPT.algo="HDCZA",
     threshold.lig = 40,
     threshold.mod = 100,
     thrshold.vig = 400,
     boutdur.in = c(10,20,30), #Bouts of inactivity in 10, 20, and 30minute durations
     boutdur.lig = 10, #Bouts of light activity in 10 min bouts
     boutdur.mvpa=c(1,5,10), #Bouts of MVPA in 1, 5, and 10 minute durations

     boutcriter.in = 0.9,
     boutcriter.lig = 0.8,
     boutcriter.mvpa = 0.8 #The fraction of a bout that needs to meet the thresholds
)

Vincent van Hees

unread,
May 1, 2025, 10:30:15 AMMay 1
to Benedict Warner, R package GGIR
Hi Ben

Given that your accelerometers are typically not worn during the night you may want to consider the guidance I provide here:

1) What do the 'Error in 1:max(summarysleep_tmp$night) : result would be too long a vector' and '7: In max(summarysleep_tmp$night) : no non-missing arguments to max; returning -Inf' refer to? Are these related to the visual reports?

Do you get the same error with release 3.2-6 and after updating your script with suggested parameters above?

2) Why does it give warnings for 4 of the files not generating reports, and yet 16 do not have (new) visual reports?
The warnings seem to relate to the old visualreport, which seems to struggle with your estimates. Consider turning off the generation of this report with parameter old_visualreport = FALSE.

3) Why are there visual reports for 213 of them, when only 187 have part 4?
The new visual report are based on the time series extracted in part 5 and do not rely on part 4 output being present or not.

I am not that concerned about having the visual reports, but what I am more worried about is me not understanding the process or the error warnings!

Best,

Vincent
Reply all
Reply to author
Forward
0 new messages