dahtah / eyelinker

R package for reading Eyelink eye tracking data
20 stars 12 forks source link

read.asc error #3

Closed siriususan closed 7 years ago

siriususan commented 7 years ago

Hi Simon, thanks for the package. I have an issue with read.asc. I get the following error when trying to read the file g2d10.zip:

> s <- read.asc('g2d10.asc')
Error in vector(type, length) : 
  vector: cannot make a vector of mode 'NULL'.
> traceback()
8: vector(type, length)
7: allocate_column(df[[var]], nrows, dfs, var)
6: output_template(dfs, nrows)
5: rbind.fill(res)
4: list_to_dataframe(res, attr(.data, "split_labels"), .id, id_as_factor)
3: ldply(valid, function(ind) mutate(blocks[[ind]][[vname]], block = ind))
2: collect("raw")
1: read.asc("g2d10.asc")

I have tried a different asc file fd-1.zip and read the file withou trouble. Any idea? Thanks. Josef

dahtah commented 7 years ago

Hi Josef. There seems to be an extra column of missing values in the raw data (a "." at the end of each line). I'm not sure what it corresponds to. The SAMPLES line is: SAMPLES GAZE LEFT RATE 250.00 TRACKING P FILTER 2 I don't know what the "P" stands for, do you? Can't find the info in Eyelink manual.

siriususan commented 7 years ago

Hi Simon, thanks for looking at the file. Regarding "P", the documentation states

“TRACKING” for the tracking mode (P = Pupil, CR = Corneal Reflection)

The missing values puzzle me too. They can be either a resolution or a velocity, but I didn't request them using options -vel or -res. The documentation states

Resolution data is included if the "-res" option is specified, and velocity data is included by the "-vel" option.

Maybe bug in edf2asc.

dahtah commented 7 years ago

I've updated the parser to allow for unknown columns in raw data, you can grab the new version using devtools::install_github. You file now loads, but please let me know if the output makes sense.

siriususan commented 7 years ago

Can load the file. The output looks good. Tank you so much.