“as.POSIXlt.character” Error in Part 5

65 views
Skip to first unread message

Juan Pablo Espinoza

unread,
Oct 11, 2024, 11:51:39 AM10/11/24
to R package GGIR

Hi everyone,

I’m encountering an issue with GGIR while processing some specific accelerometer files (".gt3x"). The error message I’m getting is:
“Error in as.POSIXlt.character(w0[k], tz = desiredtz) : character string is not in a standard unambiguous format”

It only happens with certain files, but when I check the valid weekday and weekend days for these individuals, the data appears correct. Has anyone come across this error before or know how to fix it? Any advice would be appreciated!

Thanks a lot!

Best,
Juan Pablo

Leandro Pablo Casiraghi

unread,
Oct 14, 2024, 12:21:48 PM10/14/24
to R package GGIR
Hi Juan Pablo, can you post your GGIR call so we can see your options?
Two things you might want to check in the mean time: time zone and date-time format.

Juan Pablo Espinoza

unread,
Oct 14, 2024, 1:50:27 PM10/14/24
to R package GGIR

Thank you very much for your interest in helping me, Leandro. 

Here is my script:


library(GGIR)
# General parameters
GGIR(datadir = "~/Desktop/GGIR/EyeFit/2024/RAW_4/",
     outputdir = "~/Desktop/GGIR/EyeFit/2024/OUTPUT_4/",
     studyname="EyeFit",
     desiredtz = "Chile/Continental",
     mode = (1:5),
     # Part 2 parameters
     strategy = 1,
     ndayswindow=7,
     hrs.del.start = 0,
     hrs.del.end = 0,
     maxdur = 7,
     qwindow=c(0, 24),
     windowsizes = c(5,900,3600),
     qlevels = c((24-2) /24, # MI20
                 (24-1)/24, #M60
                 (24-0.5) /24, #M30
                 (24-0.25) /24, #M15
                 (1440-5)/3440), #M05
     ilevels = c(0,50,100,200,8000),
     iglevels = 1,
     mvpathreshold =c(100.6),
     # Part 3+4 parameters
     def.noc.sleep = 1,
     HASPT.algo ="HDZA",
     do.visual = TRUE,
     do.part3.pdf = FALSE,
     includenightcrit = 16,
     excludefirst.part4 = FALSE,
     excludelast.part4 = FALSE,
     # Part 5 parameters
     # Physical activity and inactivity threshold / Cut-points Hildebrand 2014; Hildebrand 2016
     do.enmo = TRUE,
     acc.metric = "ENMO",
     threshold.lig = c(44.8), threshold.mod = c(100.6),threshold.vig = c(428.8),
     # Bout durations
     boutdur.in = c(10,20,30), boutdur.lig = c(10), boutdur.mvpa = c(1, 5, 10),
     #Fraction of a bout that need to meet thresholds
     boutcriter = 0.8,
     boutcriter.in = 0.9, boutcriter.lig = 0.8, boutcriter.mvpa = 0.8,
     # Data cleaning
     includedaycrit.part5 = 2/3,
     # Report generation
     week_weekend_aggregate.part5 = FALSE,
     do.report=c(2, 4, 5))

Leandro Pablo Casiraghi

unread,
Oct 20, 2024, 7:20:13 PM10/20/24
to R package GGIR
I have never worked with gt3x data so I don't know this, but maybe you need to use the extEpochData_timeformat argument.  The gt3x format, as far as I remember, does not carry timestamps you can read like this, so maybe it has nothing to do with it. From the manual:

extEpochData_timeformat
Character (default = “%d-%m-%Y %H:%M:%S”). To specify the time format used in the external epoch level data when argument dataFormat is set to “actiwatch_csv”, “actiwatch_awd”, “actigraph_csv” or “sensewear_xls”. For example “%Y-%m-%d %I:%M:%S %p” for “2023-07-11 01:24:01 PM” or “%m/%d/%Y %H:%M:%S” “2023-07-11 13:24:01”

Also, have you seen this? 
If you are working with ActiGraph gt3x files, install the read.gt3x package with install.packages("read.gt3x")

Vincent van Hees

unread,
Oct 23, 2024, 2:49:28 AM10/23/24
to Leandro Pablo Casiraghi, R package GGIR
Re. Leandro's comment:
I have never worked with gt3x data so I don't know this, but maybe you need to use the extEpochData_timeformat argument. The gt3x format, as far as I remember, does not carry timestamps you can read like this, so maybe it has nothing to do with it. From the manual:

Parameter extEpochData_timeformat is not relevant when working with raw data. It is only relevant when the epoch data is externally generated which means that the data file only has the epoch level summaries of movement.

Juan Pablo: I’m encountering an issue with GGIR while processing some specific accelerometer files (".gt3x"). The error message I’m getting is:

“Error in as.POSIXlt.character(w0[k], tz = desiredtz) : character string is not in a standard unambiguous format”

Please provide more details: Which GGIR part? Is error consistent in other gt3x files? Can you read the file with read.gt3x package directly? Reproducible example?.... please also search the google group history to avoid that we are solving a problem that has been solved before.

Thanks,
Vincent

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

--
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/aed56ea1-a145-4d4c-9e65-82befdd02adfn%40googlegroups.com.

Nicolas Gomez

unread,
Jun 6, 2025, 8:34:59 AMJun 6
to R package GGIR
Hi Juan Pablo, did you manage to solve the problem?  I am having the same difficulty in the analysis of some files.

Thanks, 
Nicolás

Vincent van Hees

unread,
Jun 10, 2025, 11:10:01 AMJun 10
to Nicolas Gomez, Juan Pablo Espinoza, R package GGIR
Nicolás,

I doubt Juan Pablo saw your message as I do not think google sends special notifications when someone replies to a discussion thread. I am cc-ing him here in case he wants to reply.

Alternatively, create a new thread with a new detailed description of your problem, possibly with a link to the older related threads. In that way it is easier for me to keep track of what question has been addressed and which one not.

Thanks,
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.

Juan Pablo Espinoza

unread,
Jun 10, 2025, 9:33:58 PMJun 10
to Vincent van Hees, Nicolas Gomez, R package GGIR
Hi Nicolás and Vincent,

Thanks for your message! At the time, I didn’t find a specific solution—what worked for me was going back to a previous version of GGIR where the issue didn’t appear. A few months later, I updated to the most recent GGIR version, and the problem was gone.

So I’d recommend trying the latest version if you haven’t already—it might have been fixed in one of the updates.

Hope that helps!

Best,
Juan Pablo

Nicolas Gomez

unread,
Jun 12, 2025, 3:27:09 PMJun 12
to Juan Pablo Espinoza, Vincent van Hees, R package GGIR
Hi Juan Pablo and Vincent,
Thanks for taking the time to answer the question, I will look at the GGIR version and try again.

Best,

Nicolás

Reply all
Reply to author
Forward
0 new messages