dahtah / eyelinker

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

Problem with read.asc #7

Open scienceanna opened 6 years ago

scienceanna commented 6 years ago

Hi - thanks for the package, it's very helpful!

I'm encountering a problem with the read.asc function for some data I'm working on - see the attached files. test_asc_files.zip

test.asc is a sample of 2 trials from an experiment. When attempting to run this with read.asc, I get the following error:

Error in vector(type, length) : vector: cannot make a vector of mode 'NULL'.

test_2.asc is a reduced snippet of the data that just has 1 trial - and this runs fine with read.asc for me.

Let me know if you need any more info - and thanks so much for any help you can give.

Anna

dahtah commented 6 years ago

Hi - sorry for the late reply. Which model are you using? Do you have a handbook for it? Apparently the file format has changed a bit from the manual I have for the Eyelink 1000. In the meantime, try disabling the "input" field in the samples data when generating the asc files.

dahtah commented 6 years ago

Actually, better yet: use the current github version:

devtools::install_github('dahtah/eyelinker')
NaomiHavron commented 6 years ago

Hi,

I had the same error and tried both solutions - now I get a different error: "Warning: 169041 parsing failures." (I am using an Eyelink 1000 and your package used to work perfectly for me - maybe a recent update?)

Thanks in advance!

a-hurst commented 4 years ago

Hi @scienceanna and @NaomiHavron, in the off-chance you're still looking for a solution to this problem, the issue was that your ASC files contained input port data in the samples (the 127.0 column) which eyelinker 0.1 didn't support. The latest CRAN release of eyelinker (0.2.0) fixes the issue, importing your example files just fine:

library(eyelinker)
a <- read.asc('test.asc')
a$raw
## # A tibble: 7,459 x 7
##    block    time    xp    yp    ps input cr.info
##    <dbl>   <int> <dbl> <dbl> <dbl> <dbl> <chr>
##  1     1 1581586  401.  292   4320   127 ...
##  2     1 1581588  401.  293.  4318   127 ...
##  3     1 1581590  401.  292.  4313   127 ...
##  4     1 1581592  401.  292.  4310   127 ...
##  5     1 1581594  401.  292.  4304   127 ...
##  6     1 1581596  401.  293.  4296   127 ...
##  7     1 1581598  401.  294.  4293   127 ...
##  8     1 1581600  401.  293.  4288   127 ...
##  9     1 1581602  400.  291.  4283   127 ...
## 10     1 1581604  400.  292.  4276   127 ...
## # … with 7,449 more rows

Also, if you have any more issues with the package, please open them on the project's new page (I've officially taken over maintenance): https://github.com/a-hurst/eyelinker