Error in Part 1: Error in as.POSIXct.numeric(data$time[nrow(data)]) : 'origin' must be supplied

141 views
Skip to first unread message

Laura Maenhout

unread,
Mar 24, 2024, 9:55:11 AM3/24/24
to R package GGIR

Hi Vincent and Jairo,

I’m trying to run a code to process some ActiGraph data (GT9X Link); gt3x files.

The code I am using has worked before on previous data I analysed, but currently, I bump into an error code in Part 1, and I don’t see what I’m doing wrong 😊

The code I’m using:

GGIR( ### ==========================================================

      # General parameters

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

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

      datadir = "~/UGent/Move it, Move ID!/10_Side project/Data masterproef ID/ActiGraph (PA)/001_I.gt3x",

      outputdir = "~/UGent/Move it, Move ID!/10_Side project/Data masterproef ID/ActiGraph (PA)/Results_GGIR/001_I",

      studyname = "001_I",

      overwrite = TRUE,

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

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

      # Part 1 parameters

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

      windowsizes = c(5,900,3600),

      do.cal = TRUE,

      do.enmo = TRUE,

      do.anglez = TRUE,

      chunksize = 1,

      printsummary = TRUE,

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

      # Part 2 parameters

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

      strategy = 1,

      ndayswindow = 7,

      hrs.del.start = 0,

      hrs.del.end = 0,

      maxdur = 0,

      includedaycrit = 10,

      qwindow = c(0,24),

      ilevels = c(seq(0,400,by=50),8000),

      mvpathreshold = c(100.6),

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

      # Part 3 & 4 parameters

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

      def.noc.sleep = 1,

      outliers.only = FALSE,

      criterror = 4,

      do.visual = TRUE,

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

      # Part 5 parameters

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

      treshold.lig = c(44.8),

      treshold.mod = c(100.6),

      treshold.vig = c(428.8),

      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("WW"),

      visualreport = TRUE)

 

--> The Error-code I’m getting: Error in as.POSIXct.numeric(data$time[nrow(data)]) : 'origin' must be supplied


How can I deal with this error code?

Thanks for the help!

Kind regards,
Laura

Michael Rueschman

unread,
Mar 25, 2024, 12:27:41 PM3/25/24
to R package GGIR
Hi Laura,

What version of R and GGIR are you using? And on what Operating System?

I ran your code above through on one of my .gt3x files and it completed successfully. R 4.3.3 and GGIR 3.0-9 and Windows 10.

Have you confirmed that 001_I.gt3x is intact? Does it open in ActiLife? Are there any other differences you know of between this file and others that are currently functioning with the code above?

Mike

Laura Maenhout

unread,
Apr 1, 2024, 3:59:06 PM4/1/24
to R package GGIR
Hi Michael, 

Thank you for your quick response. 

I also tried running my script on a colleague's computer, and it worked fine. It turns out the error was indeed due to the version of R.

Thanks for your assistance!

Kind regards, 
Laura

Op maandag 25 maart 2024 om 17:27:41 UTC+1 schreef Michael Rueschman:
Reply all
Reply to author
Forward
0 new messages