Error in some analyses of Activity accelerometers with GGIR package

101 views
Skip to first unread message

Marcos Echevarría Polo

unread,
Nov 29, 2023, 11:38:34 AM11/29/23
to R package GGIR
I have analyzed most of the Activity accelerometers in my study sample, but in some of them the software report me 2 types of errors.
Error 1:
> setwd("/Users/marcosechevarriapolo/Desktop")
> library(GGIR)
> GGIR(mode=c(1,2,3,4,5),
+      datadir="entrada",
+      outputdir="salida",
+      do.report=c(2,4,5),
+      #=====================
+      # Part 2
+      #=====================
+      strategy = 1,
+      hrs.del.start = 0,          hrs.del.end = 0,
+      maxdur = 16,                 includedaycrit = 16,
+      qwindow=c(0,24),
+      mvpathreshold =c(100),
+      excludefirstlast = FALSE,
+      includenightcrit = 16,
+      qlevels = c(c(960/1440),c(1320/1440),c(1380/1440),c(1410/1440),c(1425/1440),c(1430/1440),c(1435/1440),c(1438/1440)),
+      #=====================
+      # Part 3 + 4
+      #=====================
+      def.noc.sleep = 1,
+      outliers.only = TRUE,
+      criterror = 4,
+      do.visual = TRUE,
+      #=====================
+      # Part 5
+      #=====================
+      threshold.lig = c(30), threshold.mod = c(100),  threshold.vig = c(400),
+      boutcriter = 0.8,      boutcriter.in = 0.9,     boutcriter.lig = 0.8,
+      boutcriter.mvpa = 0.8, boutdur.in = c(1,10,30), boutdur.lig = c(1,10),
+      boutdur.mvpa = c(1),
+      includedaycrit.part5 = 2/3,
+      #=====================
+      # Visual report
+      #=====================
+      timewindow = c("WW"),
+      visualreport=TRUE)

Checking that user has write access permission for directory specified by argument outputdir: Yes

   GGIR version: 3.0.0

   Do not forget to cite GGIR in your publications via a version number and
   Migueles et al. 2019 JMPB. doi: 10.1123/jmpb.2018-0063.
   See also: https://cran.r-project.org/package=GGIR/vignettes/GGIR.html#citing-ggir

   To make your research reproducible and interpretable always report:
     (1) Accelerometer brand and product name
     (2) How you configured the accelerometer
     (3) Study protocol and wear instructions given to the participants
     (4) GGIR version
     (5) How GGIR was used: Share the config.csv file or your R script.
     (6) How you post-processed / cleaned GGIR output
     (7) How reported outcomes relate to the specific variable names in GGIR
_________________________________________________________________________________________________________________________
 Part 1

Checking that user has read access permission for all files in data directory: Yes
1
P1 file 1

Investigate calibration of the sensors with function g.calibrate:

Loading chunk: 1 2 3 4 5 6 7
Extract signal features (metrics) with the g.getmeta function:

Loading chunk: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Save .RData-file with: calibration report, file inspection report and all signal features...

_________________________________________________________________________________________________________________________
 Part 2
1 measurement starts at midnight or there is no midnight
_________________________________________________________________________________________________________________________
 Part 3
1
_________________________________________________________________________________________________________________________
 Part 4
 1Error in if (is.na(defaultSptOnset) == TRUE) { :
  argument is of length zero


Error 2:

> setwd("/Users/marcosechevarriapolo/Desktop")
> library(GGIR)
> GGIR(mode=c(1,2,3,4,5),
+      datadir="entrada",
+      outputdir="salida",
+      do.report=c(2,4,5),
+      #=====================
+      # Part 2
+      #=====================
+      strategy = 1,
+      hrs.del.start = 0,          hrs.del.end = 0,
+      maxdur = 16,                 includedaycrit = 16,
+      qwindow=c(0,24),
+      mvpathreshold =c(100),
+      excludefirstlast = FALSE,
+      includenightcrit = 16,
+      qlevels = c(c(960/1440),c(1320/1440),c(1380/1440),c(1410/1440),c(1425/1440),c(1430/1440),c(1435/1440),c(1438/1440)),
+      #=====================
+      # Part 3 + 4
+      #=====================
+      def.noc.sleep = 1,
+      outliers.only = TRUE,
+      criterror = 4,
+      do.visual = TRUE,
+      #=====================
+      # Part 5
+      #=====================
+      threshold.lig = c(30), threshold.mod = c(100),  threshold.vig = c(400),
+      boutcriter = 0.8,      boutcriter.in = 0.9,     boutcriter.lig = 0.8,
+      boutcriter.mvpa = 0.8, boutdur.in = c(1,10,30), boutdur.lig = c(1,10),
+      boutdur.mvpa = c(1),
+      includedaycrit.part5 = 2/3,
+      #=====================
+      # Visual report
+      #=====================
+      timewindow = c("WW"),
+      visualreport=TRUE)

Checking that user has write access permission for directory specified by argument outputdir: Yes

   GGIR version: 3.0.0

   Do not forget to cite GGIR in your publications via a version number and
   Migueles et al. 2019 JMPB. doi: 10.1123/jmpb.2018-0063. 
   See also: https://cran.r-project.org/package=GGIR/vignettes/GGIR.html#citing-ggir

   To make your research reproducible and interpretable always report:
     (1) Accelerometer brand and product name
     (2) How you configured the accelerometer
     (3) Study protocol and wear instructions given to the participants
     (4) GGIR version
     (5) How GGIR was used: Share the config.csv file or your R script.
     (6) How you post-processed / cleaned GGIR output
     (7) How reported outcomes relate to the specific variable names in GGIR
____________________________________________________________________________

Part 1 

 

Checking that user has read access permission for all files in data directory: Yes

P1 file 1

 

Investigate calibration of the sensors with function g.calibrate:

 

Loading chunk: 1 2

Extract signal features (metrics) with the g.getmeta function:

 

Loading chunk: 1

Save .RData-file with: calibration report, file inspection report and all signal features...

______________________________________________________________________

 Part 2 

_______________________________________________________________________

 Part 3 

1 P3 file NAFilename not recognizedError in readChar(con, 5L, useBytes = TRUE) : cannot open the connection

In addition: Warning message:

In readChar(con, 5L, useBytes = TRUE) : 

cannot open compressed file 'salida/output_entrada/meta/basic/meta_NA', probable reason 'No such file or directory'


What should I do??

Thanks for all.

Jairo Hidalgo Migueles

unread,
Dec 1, 2023, 9:14:00 AM12/1/23
to R package GGIR
Hi Marcos,

Can you be more specific? Try to identify the files that are triggering these errors, and see if you can process them with the minimum number of arguments possible. As for the second error, it seems like GGIR is struggling to find the part 1 milestone data for that file, it could be related to the definition of the directories.

Best,
Jairo

Reply all
Reply to author
Forward
0 new messages