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