Read EDF file with gaze data recorded by SR Research EyeLink eye tracker
Source:R/read_edf.R
read_edf.Rd
Reads EDF file with gaze data recorded by SR Research EyeLink eye tracker
and returns an eyelinkRecording
object that contains events, samples,
and recordings, as well as specific events such as saccades, fixations, blinks, etc.
Usage
read_edf(
file,
consistency = "check consistency and report",
import_events = TRUE,
import_recordings = TRUE,
import_samples = FALSE,
sample_attributes = NULL,
start_marker = "TRIALID",
end_marker = "TRIAL_RESULT",
import_saccades = TRUE,
import_blinks = TRUE,
import_fixations = TRUE,
import_variables = TRUE,
verbose = TRUE,
fail_loudly = TRUE
)
Arguments
- file
full name of the EDF file
- consistency
consistency check control for the time stamps of the start and end events, etc. Could be
'no consistency check'
,'check consistency and report'
(default),'check consistency and fix'
.- import_events
logical, whether to import events, defaults to codeTRUE
- import_recordings
logical, whether to import information about start/end of the recording, defaults to codeTRUE
- import_samples
logical, whether to import samples, defaults to
FALSE
. Please note that specifyingsample_attributes
automatically sets it toTRUE
.- sample_attributes
a character vector that lists sample attributes to be imported. By default, all attributes are imported (default). For the complete list of sample attributes please refer to
eyelinkRecording
or EDF API documentation.- start_marker
event string that marks the beginning of the trial. Defaults to
"TRIALID"
.- end_marker
event string that marks the end of the trial. Defaults to
"TRIAL_RESULT"
. Please note that an empty string''
means that a trial lasts from onestart_marker
till the next one.- import_saccades
logical, whether to extract saccade events into a separate table for convenience. Defaults to
TRUE
.- import_blinks
logical, whether to extract blink events into a separate table for convenience. Defaults to
TRUE
.- import_fixations
logical, whether to extract fixation events into a separate table for convenience. Defaults to
TRUE
.- import_variables
logical, whether to extract stored variables into a separate table for convenience. Defaults to
TRUE
.- verbose
logical, whether the number of trials and the progress are shown in the console. Defaults to
TRUE
.- fail_loudly
logical, whether lack of compiled library means error (
TRUE
, default) or just warning (FALSE
).
Value
an eyelinkRecording
object that contains events, samples,
and recordings, as well as specific events such as saccades, fixations, blinks, etc.
Examples
# \donttest{
if (eyelinkReader::compiled_library_status()) {
# Import only events and recordings information
recording <- read_edf(system.file("extdata", "example.edf", package = "eyelinkReader"))
# Import events and samples (only time and screen gaze coordinates)
recording <- read_edf(system.file("extdata", "example.edf", package = "eyelinkReader"),
sample_attributes = c('time', 'gx', 'gy'))
# Import events and samples (all attributes)
recording <- read_edf(system.file("extdata", "example.edf", package = "eyelinkReader"),
import_samples= TRUE)
}
# }