paulhibbing / AGread

Read Accelerometer Files from ActiGraph Accelerometers
Other
15 stars 4 forks source link

replacement has length zero #18

Closed arvind1609 closed 4 years ago

arvind1609 commented 4 years ago

Hello,

I'm trying to read my .gt3x files using the read_gt3x function.

file_3x <- system.file( "extdata/AP01", "AP-TAS1F36160346_2019-11-21___08-37-55.gt3x", package = "AGread" )

AG_3x <- read_gt3x(file_3x)

It gives with the following error when I try to run it - "Error in x[[jj]][iseq] <- vjj : replacement has length zero"

However, the function still works for the example provided. Any ideas on how to fix this?

paulhibbing commented 4 years ago

It looks like the path to your file isn't specified correctly.

Does file.exists(file_3x) return TRUE?

If not, try something like

file_3x <- "C:/Users/YourUserName/YourFolder/AP-TAS1...gt3x"

arvind1609 commented 4 years ago

Yes, it returns true. I switched it to file_3x <- path/AP..gt3x

I have a couple of .gt3x files. It works for one but gives me the replacement error for the others.

paulhibbing commented 4 years ago

Hmm... Could you run with verbose=TRUE and see how far it's getting before it breaks?

arvind1609 commented 4 years ago

Sure, I got this.

Processing TAS1F36160346_2019-11-19___13-15-14.gt3x

Parsing info.txt ............. COMPLETE

Will parse the following packet types, if available: METADATA, PARAMETERS, SENSOR_SCHEMA, BATTERY EVENT, TAG, ACTIVITY, HEART_RATE_BPM HEART_RATE_ANT, HEART_RATE_BLE, LUX, CAPSENSE EPOCH, EPOCH2, EPOCH3, EPOCH4 ACTIVITY2, SENSOR_DATA

Reading log.bin ............. COMPLETE Getting record headers............... COMPLETE Parsing PARAMETERS packet(s) ............. COMPLETE
Parsing SENSOR_SCHEMA packet(s) ............. COMPLETE
Parsing METADATA packet(s) ............. COMPLETE
Parsing BATTERY packet(s) ............. COMPLETE
Parsing EVENT packet(s) ............. COMPLETE
Parsing CAPSENSE packet(s) ............. COMPLETE
Checking for gaps in the time series. Fixing if found.Error in x[[jj]][iseq] <- vjj : replacement has length zero

paulhibbing commented 4 years ago

Okay. That looks like a definite bug, but it's probably going to be tricky to fix (and could be slow).

I don't think I'll be able to fix the bug without access to your file, but I realize there could be privacy concerns with sharing it. Could you record a short dummy file (no human subjects data) on your device, check if you're able to replicate the error on the dummy file, and then share it? Ideally you could also share a RAW.csv ActiLife export of the dummy file, so I can verify that my solution aligns with ActiLife.

Sorry it's not a quicker fix.

arvind1609 commented 4 years ago

Sure, I'll get back to you.

No problem.

paulhibbing commented 4 years ago

This ended up being related to an out-of-date installation.