Code not working after I updated the software

299 views
Skip to first unread message

Bryan Montero

unread,
Apr 12, 2023, 9:27:22 AM4/12/23
to R package GGIR
Hello GGIR community,

1. A couple of months ago I ran the code that I am sharing below and it gave me all the outputs I needed. I updated the version from 2.8-0 to 2.9-0, I ran it again using the same files just to confim some values and this message pop up in part 1
Error in rbind(S, data) : number of columns of matrices must match (see arg 2).

I sought in the group if someone ran into a same issue and found out this https://groups.google.com/g/rpackageggir/c/J3-86_kE4fc/m/SRqp81l6BQAJ, however, not to much detail where shared to try to fix it.

2. I also wanted to know, if the sleep log I am using in part 4 is also delimiting the time frame in part 2 or it is only applied in part 5? We are just interested in waking hours (6:00 to 23:00) trying to get the time spent in LPA and MVPA, and the intensity gradient and average acceleration. 

Participants worn ActiGraph devices for 7 consecutive days just in waking hours. All the devices started recording at 12:00 am.  I also attached some of my past documents when the code worked. In case of any other material needed let me know. 

I woud really appreciate any suggestion you can give me.

Best,

Bryan

install.packages("GGIR", dependencies = TRUE)

install.packages("remotes")

remotes::install_github("wadpac/GGIR")

library(devtools)

library(GGIR)

#=====================

# General Parameters

#=====================

g.shell.GGIR(

  mode=c(1,2,3,4,5),

  datadir= "Z:/Bryan/Accelerometry/",

  outputdir="Z:/Bryan/Accelerometry/GGIR/",

  f0= 1,

  desiredtz ="America/Chicago",

  #America/Chicago

  do.report=c(2,4,5),

  idloc=2,

  print.filename= TRUE,

 #=====================

  # Part 1

  #=====================

  windowsizes = c(5,60,3600),

  do.cal=TRUE,  

  do.enmo = TRUE,

  do.anglez=TRUE,

  chunksize=1,  

 #=====================

  # Part 2

  #=====================

  strategy = 1,

  hrs.del.start = 0,

  hrs.del.end = 0,

  maxdur = 7,   

  wear_dur_def_proto_day = 7,

  includedaycrit = 10,

  M5L5res = 5,

  winhr = c(0.5, 1.0, 2.0),

  qlevels = c(c(1020/1080),c(1050/1080),c(1078/1080)),

  qwindow= c(0,24),

  ilevels = c(0, 47.4, 69.1, 258.7, 8000),

  mvpathreshold = c(69.1),

  boutcriter = c(0.8), #

  mvpadur= c(1,5,10),

  bout.metric = 6,

  #=====================

  # Part 3

  #=====================

  anglethreshold = c(5),

  timethreshold = 5,

  acc.metric="ENMO",

  ignorenonwear=TRUE,

  overwrite=FALSE,

  constrain2range=TRUE,

  do.part3.pdf=TRUE,

  do.parallel=FALSE,

 #=====================

  # Part 4

  #=====================

  loglocation = ("Z:/Bryan/Accelerometry/GGIR//SLEEP.csv"),

  excludefirst.part4= FALSE,

  def.noc.sleep = 1,

  sleepwindowType = "SPT",

  outliers.only = TRUE,

  criterror = 4,

  relyonguider = FALSE,

  sleeplogidnum = FALSE,

  colid=1,

  coln1=2,

  do.visual = FALSE,

  nnights = 7,

  sleeplogsep = ",",

  #=====================

  # Part 5

  #=====================

  excludefirstlast.part5 =FALSE,

  threshold.lig = c(47.4),

  threshold.mod = c(69.1),

  threshols.vig = c(258.7),

  boutcriter.in = 0.9,        

  boutcriter.lig = 0.8,

  boutcriter.mvpa = 0.8,      

  boutcriter.vig = 0.8,       

  boutdur.in = c(5,10,20,30),

  boutdur.lig = c(1,5,10),

  boutdur.mvpa = c(1,5,10),

  boutdur.vig = c(1,5),

   #=====================

  # Visual report

  #=====================

  timewindow = "MM",

  visualreport=TRUE)

 


part4_nightsummary_sleep_cleaned.csv
part5_daysummary_MM_L47.4M69.1V400_T5A5.csv
part5_personsummary_MM_L47.4M69.1V400_T5A5.csv
part2_summary.csv
part2_daysummary.csv
PA001_PreRAW.csv.RData
part4_summary_sleep_cleaned.csv
SLEEP.csv

Leticia Sewaybricker

unread,
Apr 14, 2023, 11:38:57 AM4/14/23
to R package GGIR
Hi Bryan,
I just experienced exactly the same thing and am getting the same error message.
Participants wore actigraph 24h/d for 7 days and I have always used csv files in GGIR.
Please, let me know if you had any insights.
Thanks!
Leticia

Vincent van Hees

unread,
Apr 15, 2023, 9:43:23 AM4/15/23
to Bryan Montero, R package GGIR
Hi Bryan,


1. A couple of months ago I ran the code that I am sharing below and it gave me all the outputs I needed. I updated the version from 2.8-0 to 2.9-0, I ran it again using the same files just to confim some values and this message pop up in part 1
Error in rbind(S, data) : number of columns of matrices must match (see arg 2).

Can you share your meta/basic RData file? It seems you only shared the RData file from meta/ms2.out, which does not allow me to replicate the issue.

2. I also wanted to know, if the sleep log I am using in part 4 is also delimiting the time frame in part 2 or it is only applied in part 5? We are just interested in waking hours (6:00 to 23:00) trying to get the time spent in LPA and MVPA, and the intensity gradient and average acceleration.

The sleeplog is only used in part 4 and affects output from part 4 and 5. Part2 is not influenced by sleeplog.

Best,

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/87157a42-1357-4534-9653-7419c8a97a31n%40googlegroups.com.

Bryan Montero

unread,
Apr 15, 2023, 3:07:33 PM4/15/23
to Vincent van Hees, R package GGIR
Hello Vincent,

Thank you so much for your prompt response.

Find some of the meta files attached.

Best,

Bryan

El sáb, 15 abr 2023 a las 13:59, Bryan Montero (<bryanm...@gmail.com>) escribió:
Hello Vincent,

Thank you so much for your prompt response.

Find some of the files attached.

Best,

Bryan
meta_PA002_PreRAW.csv.RData
meta_PA001_PreRAW.csv.RData
meta_PA003_PreRAW.csv.RData

Vincent van Hees

unread,
Apr 29, 2023, 4:20:47 AM4/29/23
to Bryan Montero, leti...@gmail.com, R package GGIR
Hi Bryan and Leticia,

I am still not able to reproduce your issue. Can you please help to identify where the error occurs:

  • Does it still occur when you delete the config.csv file?
  • Can you run each GGIR part individually to identify in which part the error occurs, e.g. first mode = 1, then mode = 2, etc..
  • Can you trying running GGIR with just the default settings and then with some of your own settings to help identify whether it may be specific to one of your settings?
  • Can you try identify whether it works with just one file in the input folder?
  • Can you identify the one or two test files that allow to reproduce the issue? Please then sent me the R script + the files to reproduce the issue.

Sorry for the slow reply, I had to prioritise paying customers.

Thanks,

Vincent

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

------- Original Message -------
On Saturday, April 15th, 2023 at 9:07 PM, Bryan Montero <bryanm...@gmail.com> wrote:

Hello Vincent,

Bryan Montero

unread,
Apr 29, 2023, 7:48:14 AM4/29/23
to Vincent van Hees, leti...@gmail.com, R package GGIR
Hello Vincent,

Thank you for your advice.

I will do that and get back to you.

Best,

Bryan 

Leticia Sewaybricker

unread,
May 1, 2023, 5:38:28 PM5/1/23
to R package GGIR
Hi Vincent and Bryan,

Vincent, thank you for working on this.

Please, find attached the file from a single participant, the R script I have been using, as well as the error message I get in Rstudio.

To address Vincent's points:
  • Does it still occur when you delete the config.csv file? I am getting the error message and I have not used a config.csv file for this analysis.
  • Can you run each GGIR part individually to identify in which part the error occurs, e.g. first mode = 1, then mode = 2, etc.. I got the error message when trying to run solely step 1 (mode = 1).
  • Can you trying running GGIR with just the default settings and then with some of your own settings to help identify whether it may be specific to one of your settings? I got the same error when just using the bare minimum:  library(GGIR) GGIR(datadir="C:/mystudy/mydata", outputdir="D:/myresults").
  • Can you try identify whether it works with just one file in the input folder? I get the error message even with a single file in the input folder.
  • Can you identify the one or two test files that allow to reproduce the issue? Please then sent me the R script + the files to reproduce the issue. Attached R script (adapt_ggir.R) and what I see in the Rstudio console (adapt_outputR.txt).

Happy to share any other information that is needed.

Thanks,

Leticia

adapt_outputR
adapt_ggir.R

Vincent van Hees

unread,
May 9, 2023, 11:13:04 AM5/9/23
to Leticia Sewaybricker, R package GGIR
Hi both,

I think I fixed the issue, can you please test the solution and let me know if this addressed it?

To install this test version do:

install.package("remotes")
remotes::install_github("wadpac/GGIR", ref = "issue784_handling_columns_csv_actigraph")

Thanks,

Vincent
------- Original Message -------

Leticia Sewaybricker

unread,
May 10, 2023, 7:40:47 PM5/10/23
to R package GGIR
Hi Vincent and Bryan,

Vincent - I went ahead and ran a few tests with a single file (participant) and all seems to be working great.
I will keep working on it and will keep you posted if there is anything different.

Thank you once again for the work you do and to help us through this issue.

Best regards,

Leticia
Message has been deleted
Message has been deleted

Bryan Montero

unread,
May 24, 2023, 5:56:17 PM5/24/23
to R package GGIR
Hello,

Thank you so much Vincent, I thought I followed up this email but I did not. I reduced already all my files and seems to be working very well.

As Leticia said, thank you so much for your assistance to solve the issue.

Sincerely,

Bryan

Melitta McNarry

unread,
Jun 19, 2023, 9:08:59 AM6/19/23
to R package GGIR
Hi All,

I have come across the same error as mentioned in this thread but using the suggested test version hasn't worked. Would anyone be able to provide some suggestions on how to resolve this issue please?

I am using GGIR 2.9-0 and have tried running just a subsample of those files that are producing this error. The error occurs even when I only stipulate mode 1 to be run using the following script:

library(GGIR)
g.shell.GGIR(#-------------------------------
             # General parameters
             
             #-------------------------------
             mode=c(1),
             
             datadir="C:/Users/M.McNarry/Downloads/Not Running",
             outputdir="C:/Users/M.McNarry/Downloads",
             studyname = "Test_Data",
             f0=0,
             f1=5,
            overwrite = TRUE,
             do.imp=TRUE,
             idloc=1,
             print.filename=TRUE,
             storefolderstructure = FALSE,
             #-------------------------------
             # Part 1 parameters:
             #-------------------------------
             windowsizes = c(1,900,3600),

             do.cal=TRUE,
             do.enmo = TRUE,
             do.anglez=TRUE,
             chunksize=1,
             printsummary=TRUE,
             #---------/---                    -------------------
             # Part 2 parameters:
             #-------------------------------
             strategy = 3,

             hrs.del.start = 0,
             hrs.del.end = 0,
             maxdur = 8,
             includedaycrit = 16,
             L5M5window = c(0,24), #time window for least and most active period, defined by winhr
             M5L5res = 10,
             winhr = c(0.5,1), # period of time to calculate start time, and average acceleration for least and most active bout; e.g., 0.5=30 mins, 0.25=15min, etc
             qlevels = c( c(1260/1440), c(1380/1440),c(1395/1440),
                          c(1410/1440), c(1425/1440), c(1435/1440)), #M180, M60, M45, M30, M15, M5
             qwindow=c(0,24),
             ilevels = c(0,50,201.4,707,8000),
             iglevels = TRUE,
             mvpathreshold =c(0,50,201.4,707,8000),
             #-------------------------------
             # Part 3 parameters:
             #-------------------------------
             timethreshold= c(5,10),
             anglethreshold=5,
             ignorenonwear = TRUE,
             #-------------------------------
             # Part 4 parameters:
             #-------------------------------
             excludefirstlast = FALSE,
             includenightcrit = 16,
             def.noc.sleep = c(1),
             outliers.only = FALSE,

             criterror = 4,
             relyonguider = FALSE,
             sleeplogidnum = FALSE,
             do.visual = TRUE,
             #-------------------------------
             # Part 5 parameters:
             #-------------------------------
             threshold.lig = c(50),
             threshold.mod = c(201.4),
             threshold.vig = c(707),
             excludefirstlast = FALSE,
             boutcriter = 0.8,

             boutcriter.in = 0.9,
             boutcriter.lig = 0.8,
             boutcriter.mvpa = 0.8,
             boutdur.in = c(10,20,30),

             boutdur.lig = c(1,5,10),
             boutdur.mvpa = c(1,5,10),
             timewindow = c("MM","WW"),
             #-----------------------------------
             # Report generation
             
             #-------------------------------
             do.report=c(2,4,5))
## End(Not run)

Any help appreciated!

thanks

Mel

Daniel Bannell

unread,
Jul 24, 2023, 10:32:34 AM7/24/23
to R package GGIR
Hi All,

I am currently having the same error cited above and the fix above does not seem to be working for me either. 

Here is the error code:  Error in rbind(S, data) : number of columns of matrices must match (see arg 2)

A very limited number of my files have gone through part 1 correctly (running part 1 alone) but these seem to be ones very small in size, the majority of my files will receive the above error. 

Any help on how to resolve this would be hugely appreciated.

Thanks,

Daniel 

Here is my script:
library(GGIR)
g.shell.GGIR(
  mode=c(1),
  datadir="removed for personal info",
  outputdir=" removed for personal info  ",
  do.report=c(2),
  do.parallel=FALSE,
  f0 = 1,
  f1 = 9,
  overwrite=TRUE,

  #=====================
  # Part 2
  #=====================
  strategy = 1,
  ndayswindow=7,
  hrs.del.start = 1,
  hrs.del.end = 1,
  maxdur = 18,
  includedaycrit = 10,
  L5M5window = c(0,24),
  M5L5res = 10,
  winhr = c(5,10),
  qlevels = c(c(1380/1440),c(1410/1440)),
  qwindow=c(0,24),
  ilevels = c(0,45,101,429,8000),
  iglevels = TRUE,
  mvpathreshold =c(45, 101, 429),
  boutcriter = c(0.8),            mvpadur = c(1,5,10),
  bout.metric = 4,
  #=====================
  # 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.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)

Jairo Hidalgo Migueles

unread,
Jul 26, 2023, 11:33:10 AM7/26/23
to R package GGIR
Hi Daniel,

I see you have defined f0 = 1 and f1 = 9, so I would expect a maximum of 9 files being processed by GGIR, is that the case? As for the error, what version of GGIR are you using, and when exactly do you get the error? I see you are only running part 1 (mode = 1), but then you try to extract reports from part 2, which is not possible because part 2 has not been run yet.

Best,
Jairo

Daniel Bannell

unread,
Jul 26, 2023, 11:39:29 AM7/26/23
to Jairo Hidalgo Migueles, R package GGIR
Hi Jairo,

Yes, as it was not running properly I was testing on a small sample of files rather than having to wait for lots of file to process to define any errors. 

I was only running part 1, and then once meta files are created I would have run part 2 - but unfortunately the error has occurred before I got to this stage. The error occurs when processing the first file through part 1. During the 'chunking' it will stop and this error will appear.

Unfortunately, I do not currently have access to the work computer with GGIR, but I believe it is the most up to date version.

 A colleague in Australia (I'm in the UK) has successfully run my files through GGIR 2.3-0 with no issues.

I have seen other people mention this error in this group but the suggested fix is not working for me.

Many thanks,
Daniel

You received this message because you are subscribed to a topic in the Google Groups "R package GGIR" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/RpackageGGIR/iCZUfxWhMUg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to RpackageGGIR...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/RpackageGGIR/492436e4-eaeb-41a5-92d5-bcf8c87cc951n%40googlegroups.com.

Jairo Hidalgo Migueles

unread,
Jul 26, 2023, 11:53:25 AM7/26/23
to R package GGIR
Can you see your files in the folder "meta/basic"? Otherwise, can you share one of the files that you did not get in that folder?

Best,
Jairo

Reply all
Reply to author
Forward
0 new messages