Hi All,
I'm stuck with an error and unsure how to troubleshoot. We use old Actigraph w3gtx devices. Download and export the data to CSV format without timestamps. Actigraphs are mailed, worn for 2 weeks, off for 2 weeks and then worn again for 2 weeks before being mailed back and data downloaded. I took data from two quite compliant participants to use for testing. Folder structure like this:
I've checked and the CSV files definitely contain data. Here is a sample from the less command.
Whenever I try to run GGIR, I get the following:
_________________________________________________
Part 1
Checking that user has read access permission for all files in data directory: Yes
Checking that user has write access permission for directory specified by argument outputdir: Yes
Busy processing ... see /Users/wileyj/tmpcsv/scored/output_raw/meta/basic for progress
Errors and warnings for SC02 (2021-01-29)RAW.csv$message
[1] "cannot open the connection"
$call
gzfile(file, "wb")
Errors and warnings for SC03 (2021-02-12)RAW.csv$message
[1] "cannot open the connection"
$call
gzfile(file, "wb")
_______________________________________________________________
Part 2
1 Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection
In addition: Warning messages:
1: In dir.create(file.path(metadatadir, ms2.out)) :
cannot create dir '/Users/wileyj/tmpcsv/scored/output_raw//meta/ms2.out', reason 'No such file or directory'
2: In readChar(con, 5L, useBytes = TRUE) :
cannot open compressed file '/Users/wileyj/tmpcsv/scored/output_raw/meta/basic/NA', probable reason 'No such file or directory'
The files are definitely present. They are in my user folder with read/write permissions. I have current versions of GGIR and GGIRread from CRAN. Here is SessionInfo()
R version 4.2.2 (2022-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.5
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib
locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] GGIRread_0.3.0 GGIR_2.10-1
loaded via a namespace (and not attached):
[1] compiler_4.2.2 parallel_4.2.2 tools_4.2.2 Rcpp_1.0.10
[5] codetools_0.2-19 doParallel_1.0.17 iterators_1.0.14 foreach_1.5.2
[9] data.table_1.14.8 tcltk_4.2.2
I'm at a loss for best next steps. I'm not worried about the Part 2 as clearly Part 1 is failing. Because of how many layers GGIR has, I'm not sure the best steps even to try to debug this and figure out what / where it is failing. Any thoughts / suggestions on things to try or even debugging steps to take would be welcome. The GGIR call is provided at the end.
Many thanks,
Josh
datadir <- "/Users/wileyj/tmpcsv/raw"
outputdir <- "/Users/wileyj/tmpcsv/scored"
loglocation <- "/Users/wileyj/tmpcsv/sleeplog.csv"
GGIR(mode=c(1,2,3,4,5),
datadir = datadir,
outputdir = outputdir,
do.report=c(2,4,5),
#=====================
# Part 2
#=====================
strategy = 1,
hrs.del.start = 0, hrs.del.end = 0,
maxdur = 9, includedaycrit = 16,
qwindow=c(0,24),
mvpathreshold =c(100),
excludefirstlast = FALSE,
includenightcrit = 16,
#=====================
# Part 3 + 4
#=====================
def.noc.sleep = 1,
outliers.only = TRUE,
criterror = 4,
do.visual = TRUE,
#=====================
# Part 5
#=====================
threshold.lig = c(30), threshold.mod = c(100), threshold.vig = c(400),
boutcriter = 0.8, boutcriter.in = 0.9, boutcriter.lig = 0.8,
boutcriter.mvpa = 0.8, boutdur.in = c(1,10,30), boutdur.lig = c(1,10),
boutdur.mvpa = c(1),
includedaycrit.part5 = 2/3,
#=====================
# Visual report
#=====================
timewindow = c("WW"),
visualreport=TRUE)