read.asc: Read EyeLink ASC Files

Description Usage Arguments Details Value Author(s) Examples

View source: R/eyelink_parser.R

Description

Imports data from EyeLink ASC files into (relatively) tidy data frames for analysis and visualization. Event data and/or raw sample data from the files can be imported, along with information about the tracker hardware and configuration. All data is divided into numbered blocks using the "START" and "END" messages in the ASC file.

Usage

1
2
3
read.asc(fname, samples = TRUE, events = TRUE, parse_all = FALSE)

read_asc(fname, samples = TRUE, events = TRUE, parse_all = FALSE)

Arguments

fname

character vector indicating the name of the .asc file to import.

samples

logical indicating whether raw sample data should be imported. Defaults to TRUE.

events

logical indicating whether event data (e.g. saccades, blinks, messages, etc.) should be imported. Defaults to TRUE.

parse_all

logical indicating whether samples/events not within START/END blocks should be parsed. Defaults to FALSE.

Details

ASC files can contain anywhere between 125 to 2000 rows of samples for every second of recording, meaning that the resulting files can be very large (1.2 million rows of samples for 20 minutes at 1000Hz). As a result, importing some ASC files can be slow, and the resulting data frames can take up 100's of MB of memory. To speed up import and greatly reduce memory load, you can choose to ignore raw samples and only import events by setting the samples parameter to FALSE.

This function returns a list containing the following possible data frames:

raw

Raw sample data

sacc

Saccade end events

fix

Fixation end events

blinks

Blink end events

msg

Messages sent or received by the tracker

input

Input port (TTL) events

button

Button box / gamepad events

info

Tracker settings/configuration metadata

The names of the columns in these data frames correspond to column names given in the ASC section of the EyeLink 1000 User's Guide.

Note that this function cannot import EDFs directly; they must be converted to plain-text ASC using the edf2asc utility before importing.

Value

A list of tibbles containing data from the .asc file.

Author(s)

Simon Barthelme & Austin Hurst

Examples

1
2
3
4
# Example file from SR research that ships with the package
fpath <- system.file("extdata/mono500.asc.gz", package = "eyelinker")
dat <- read.asc(fpath)
plot(dat$raw$time, dat$raw$xp, xlab = "Time (ms)", ylab = "Eye position along x-axis (pix)")

eyelinker documentation built on June 4, 2021, 1:10 a.m.