Novice issue: Cannot even start opening a file

212 views
Skip to first unread message

Leandro Casiraghi

unread,
Apr 6, 2021, 5:51:48 PM4/6/21
to R package GGIR
Hi all and thanks Vincet for the hard work on GGIR,
I'm a sleep researcher currently at the University of Washington but moving very soon back to my country in Argentina. I have worked until now using the Philips Actiwatch but due to its high price tag (and consequently, its impossible-to-afford cost in Argentina), I'm trying to switch to the much more affordable AX3 from Axivity.
I have a couple of one-week recordings using the Actiwatch and the AX3 so I can compare the sleep determinations from each.
I'm trying to run the AX3 .cwa files with GGIR (version 2.3-0) and I cannot even start the code! This is what I get right out of the gate:

Part 1
Error in data_tmp[[1]][1:data_ln] :  
only 0's may be mixed with negative subscripts

I tried changing the name of the files to something with no digits, and using the .wav export instead of the .cwa, but nothing changed. Only AX3 files are stored in the datadir folder, no other files. I searched for this error here in the forum but nobody reported it. 
This is surely some dumb thing, but I just cannot figure it out!

Thank you all for any suggestion or hint.
Leandro

ben_m...@hotmail.com

unread,
Apr 7, 2021, 5:04:44 AM4/7/21
to R package GGIR
Hi Leandro, 

Can you share the full code you are trying to run, this is the easiest way to spot where the issue might be. I've recently run a batch of ~700 .cwa files using the same version without any problems.

Ben

Leandro Casiraghi

unread,
Apr 7, 2021, 12:06:49 PM4/7/21
to R package GGIR
Hi Ben, thanks for helping out. 
Here's what I did; I switched from my own files to the "longitudinal_data.cwa"  file that is provided by AX3 for testing (http://www.axivity.com/files/resources/longitudinal_data.zip).
I tried to run the minimal command in the shape:
> g.shell.GGIR(datadir="./Raw/Test", outputdir="./Output")
[...]
Part 1
Error in data_tmp[[1]][1:data_ln] :  
only 0's may be mixed with negative subscripts

The same happens with my own generated files. I also tried to run the full detailed version of the command as indicated in the tutorial in https://cran.r-project.org/web/packages/GGIR/vignettes/GGIR.html#235_Example_call

When I only try to read a .cwa file using g.cwaread  I get the correct header but no data:
> cwa <- g.cwaread("./Raw/Test/longitudinal_data.cwa", progressBar = FALSE)
> cwa$header
$uniqueSerialCode
[1] 1696
$frequency
[1] 100
$start
[1] "2013-02-19 13:00:04 PST"
$device
[1] "Axivity"
$firmwareVersion
[1] 33
$blocks
[1] 502810
$accrange
[1] 8
$hardwareType
[1] "AX3"
> cwa$data
NULL

ben_m...@hotmail.com

unread,
Apr 7, 2021, 12:48:33 PM4/7/21
to R package GGIR
That's bizarre, I just downloaded the test file and ran it using this, and it worked first time:
> g.shell.GGIR(datadir="D:/Raw/Test", outputdir="D:/Output")
Maybe worth specifying your drive as I have done just to be sure, I never like using shortcuts personally. There is also the option of restarting R, sometimes works.

Ben

Leandro Casiraghi

unread,
Apr 8, 2021, 1:40:26 PM4/8/21
to R package GGIR
You gotta be kidding me!

Maybe worth specifying your drive as I have done just to be sure, I never like using shortcuts personally.

This literally did it. I would have never, ever, thought that that could be an issue.
Thank you so much. Now, to see what came out of it!
leandro

ben_m...@hotmail.com

unread,
Apr 8, 2021, 1:53:20 PM4/8/21
to R package GGIR
No problem Leandro, glad it worked for you :)
Ben

Vincent van Hees

unread,
Apr 9, 2021, 10:44:39 AM4/9/21
to Leandro Casiraghi, R package GGIR
Hi Leandro,

The .cwa file should normally work be good for GGIR.

Are you able to inspect the file with the OMGUI software? If yes, do you see a clear movement pattern that lasts at least a couple of hours?

Can you share R script to run GGIR?
Have you tried processing the file on a different laptop?

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

Vincent van Hees

unread,
Apr 9, 2021, 10:48:47 AM4/9/21
to Leandro Casiraghi, R package GGIR
... sorry, I now see that you already resolved the issue with the help of Ben!
Thanks both,
Vincent



‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Reply all
Reply to author
Forward
0 new messages