error in mode == 0

328 views
Skip to first unread message

Megan Sison

unread,
Jun 5, 2022, 11:54:46 AM6/5/22
to R package GGIR
Hi, 
I am using GGIR to analyse data from axivity sleep trackers for my masters research. I have successfully used this for several weeks now, but it has just stopped working and keeps coming up with the following error message:

Error in mode == 0 :
  comparison (1) is possible only for atomic and list types

I have restarted R, and ensured all packages are up to date. I would really appreciate any guidance as I have little time left to complete my research.

I am using the following R script:

rm(list=ls())
graphics.off()
#==================================================================
f0 = 1  
f1 = 1
mode= c(1,2,3,4)
datadir= "C:/Users/megan/OneDrive/mystudy/mydata"
outputdir= "C:/Users/megan/OneDrive/mystudy/myresults"
studyname="test"
#=================================================
library(GGIR)
g.shell.GGIR(#-------------------------------
             # General parameters
             #-------------------------------
             mode=mode,
             datadir=datadir,
             outputdir=outputdir,
             studyname=studyname,
             f0=f0,
             f1=f1,
             overwrite = TRUE,
             do.imp=TRUE,
             idloc=1,
             print.filename=FALSE,
             storefolderstructure=FALSE,
             #-------------------------------
             # 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 = 9,
             includedaycrit = 16,
             L5M5window = c(0,24),
             M5L5res = 10,
             winhr = c(5,10),
             qlevels = c(c(1380/1440),c(1410/1440)),
             qwindow=c(0,24),
             ilevels = c(seq(0,400,by=50),8000),
             mvpathreshold =c(100,120),
             #-------------------------------
             # Part 3 parameters:
             #-------------------------------
             timethreshold=5,
             anglethreshold= 5,
             ignorenonwear = TRUE,
             #-------------------------------
             # Part 4 parameters:
             #-------------------------------
             excludefirstlast = FALSE,
             includenightcrit = 16,
             def.noc.sleep = 1,
             # loglocation= "D:/sleeplog.csv,"
             outliers.only = FALSE,
             criterror = 4,
             relyonsleeplog = FALSE,
             sleeplogidnum = TRUE,
             colid=1,
             coln1=2,
             do.visual = TRUE,
             nnights = 9,
             #-------------------------------
             # Report generation
             #-------------------------------
             do.report=c(2,4))
visualreport=TRUE
dofirstpage = TRUE
viewingwindow=2

Thank you in advance,
Megan 


Vincent van Hees

unread,
Jun 6, 2022, 7:00:27 AM6/6/22
to Megan Sison, R package GGIR
Hi Mega,

Can you try replacing g.shell.GGIR( by GGIR(.

I recently added function GGIR as alternative to function g.shell.GGIR. My intention was to preserve g.shell.GGIR functionality, but possibly something went wrong. The idea at least is that when a user call g.shell.GGIR it actually uses GGIR in the background. I will look into it to fix this, but in the mean time replacing g.shell.GGIR by GGIR in your script should address the issue.

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/fe1c728f-c6a1-4275-a5c9-109e4c3592dbn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages