A question regarding day segment analyses with GGIR

127 views
Skip to first unread message

Julia ZZ

unread,
Jan 24, 2022, 1:47:11 PM1/24/22
to R package GGIR
Hi all,

I wonder if anyone has the experience with day segment analyses. I keep meeting a warning in the process:
Report part 2
 1 2 3Warning message:
In g.conv.actlog(qwindow, qwindow_dateformat) :
 Date not recognised in activity diary. We expect format /%d-/%m-/%Y but we see 04-11-2020 04-11-2020 25-10-2020 23-10-2020 23-10-2020 25-10-2020. You need to update the qwindow_dateformat argument, and check that dates are in a consistent format.


However, my activity log did show the date as 04-11-2020 (Nov 4th, 2020), 04-11-2020 (Nov 4th, 2020), 25-10-2020 (Oct 25th, 2020),  23-10-2020 (Oct 25th, 2020), 23-10-2020 (Oct 23rd, 2020),  and 25-10-2020 (Oct 25th, 2020). In addition, I did specify the qwindow_dateformat as "/%d-/%m-/%Y".  So, I am a little bit confused. Can anyone help me with it? Thank you very much. 

Sincerely,
Julia

Vincent van Hees

unread,
Jan 31, 2022, 7:59:31 AM1/31/22
to Julia ZZ, R package GGIR
Hi Julia,
That is indeed peculiar.

I am not an Excel expert but I am now wondering whether it is possible that the dates are stored as m/d/Y even though you may have changed the way they are visually formatted. What happens if you specify "/%m-/%d-/%Y"?

Also, if you could send me your .csv file that be helpful. Just snapshot of the first couple of lines should be sufficient.

Thanks, 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/1419532d-ed8d-4b56-8978-8f16a229538fn%40googlegroups.com.

Julia ZZ

unread,
Feb 5, 2022, 3:48:12 PM2/5/22
to R package GGIR
Hi Vincent,

Thank you very much for the reply. I tried to specify "/%m-/%d-/%Y", it shows similar warning. So I put the current codes, 2 basic files, and activity logs (both excel and csv version) to the email. Can you help me with it?

library(GGIR)
datadir="V:/ACOI/.../CSV_all"
outputdir="V:/ACOI/.../test_activitylog"

g.shell.GGIR(

  datadir=datadir,
  outputdir=outputdir,
  studyname="Attempt1",
  idloc=6,
  f0=1,
  f1=2,
  mode=c(2),
  #mode = 1:2, # <= run GGIR parts 1 and 2 #revised based on the vignettes
  do.report = 2, # <= generate csv-report for GGIR part 2 #revised based on the vignettes
  qwindow = "V:/ACOI/.../activitylog_test_2files.csv", #revised based on the vignettes
  overwrite=TRUE,
#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), #revised based on the vignettes
        qwindow_dateformat = "/%d-/%m-/%Y", #revised based on the vignettes
        #qwindow_dateformat = "/%md-/%d-/%y", #revised based on the vignettes
        qlevels = c(c(1380/1440),c(1410/1440)),
        ilevels = c(0,36, 201, 707, 8000),
        mvpathreshold = c(201),
        boutcriter = 0.8,
              bout.metric = 6 ,
        epochvalues2csv=TRUE,
        mvpadur=c(1,5,10),
        iglevels = TRUE, #this function calculates intensity gradient
        do.parallel = TRUE)

warnings()


Sincerely, 
Julia
meta_1020RAW.csv.RData
activitylog_test_2files.xlsx
activitylog_test_2files.csv
meta_1026RAW.csv.RData

Julia ZZ

unread,
Feb 7, 2022, 10:52:12 PM2/7/22
to R package GGIR
Hi Vincent,

I am very sorry to bother you again, but I have an additional question beside my last post. After I update GGIR to 2.6.0, the segment file GGIR processing keeps showing error "Error in strptime(x, format, tz = "GMT") : invalid 'format' argument". It was no error when I used the last version. I wonder if you have any answers for it and my last questions regarding "/%d-/%m-/%Y warning". Thank you very much.

Sincerely,
Julia

On Monday, January 31, 2022 at 7:59:31 AM UTC-5 Vincent van Hees wrote:

Vincent van Hees

unread,
Feb 20, 2022, 11:36:56 AM2/20/22
to Julia ZZ, R package GGIR
This should now be fixed in the GGIR development version. Please install for the time being with: 
library(remotes)
remotes::install_github("wadpac/GGIR")

Further,
  • use  "%d-%m-%Y" without the forward slashes.
  • Remove the dots in your activitylog file. Cells for missing values should be left empty.

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

Julia ZZ

unread,
Feb 21, 2022, 12:49:10 PM2/21/22
to R package GGIR
Hi Vincent,

Thank you for your reply. I am using the most updated GGIR version and revise the activity log as you suggested, however it keeps showing the following information:
when process part 2:
Errors and warnings for meta_1034RAW.csv.RData$message
[1] "NA/NaN argument"

$call
fi:(fi - 1 + length(ML5colna))


when generate the part 2 report: 
Error: cannot allocate vector of size 1.1 Gb

I am very confused about those two messages. I wonder if you have any answers for it. Thank you very much.

Sincerely,
Julia

Vincent van Hees

unread,
Mar 2, 2022, 12:05:23 PM3/2/22
to Julia ZZ, R package GGIR

Hi Julie,
See below the R code I used on your data a couple weeks ago, and it worked then. Can you try and see whether it works for you on the same files you send me?


g.shell.GGIR( 
  datadir=datadir,
  outputdir=outputdir,
  studyname=studyname,
  idloc=6,
  f0=1,
  f1=2,
  mode=c(2),
  #mode = 1:2, # <= run GGIR parts 1 and 2 #revised based on the vignettes
  do.report = 2, # <= generate csv-report for GGIR part 2 #revised based on the vignettes
  qwindow = "/home/vincent/data/investigating_issues/JuliaZZ/activitylog_test_2files.csv", #revised based on the vignettes
  overwrite=TRUE,
  #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), #revised based on the vignettes
  qwindow_dateformat = "%d-%m-%Y", #revised based on the vignettes
  #qwindow_dateformat = "/%md-/%d-/%y", #revised based on the vignettes
  qlevels = c(c(1380/1440),c(1410/1440)),
  ilevels = c(0,36, 201, 707, 8000),
  mvpathreshold = c(201),
  boutcriter = 0.8,
  bout.metric = 6 ,
  epochvalues2csv=TRUE,
  mvpadur=c(1,5,10),
  iglevels = TRUE, #this function calculates intensity gradient
  do.parallel = FALSE
  ) #viewingwindow of visual report: 1 centres at day and 2 centers at night



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