jwdink / eyetrackingR

This package is designed to make dealing with eye-tracking data easier. It addresses tasks along the pipeline from raw data to analysis and visualization.
http://eyetrackingr.com
Other
82 stars 20 forks source link

silent error in add_aoi with factor AOI names #62

Closed mekline closed 6 years ago

mekline commented 6 years ago

I just discovered a quirk of add_aoi() - if you attempt to pass it a dataframe variable that has been cast to a vector, it will fail silently, and write it to an existing column (I think the column number corresponding to the level of the factor it happens to be?) rather than making a new one. This happened as I was trying to loop through a csv of several different AOIs - the default behavior of read.csv is to treat all strings as factors, so if this can't be changed, a note in the docs to that effect could be helpful.

Works fine:

screen shot 2018-04-02 at 4 56 01 pm screen shot 2018-04-02 at 4 56 10 pm

Bad behavior:

screen shot 2018-04-02 at 4 57 20 pm screen shot 2018-04-02 at 4 57 05 pm