eyemerge: Create data frame of merged eyetracking and behavioral data

Description Usage Arguments Value See Also Examples

Description

Function for creating a flat table of eyetracking and behavioral data from itrackR object. Can be used for gathering fixation, saccade or blink data, as well as fixation data epoched around some event. Will include all behavioral variables, or a subset of named variables.

Usage

1
2
3
eyemerge(obj, eyedata = "fixations", behdata = "all", all.rois = F,
  event = NULL, roi = NULL, trialtime = TRUE, condition = NULL,
  condition.str = FALSE)

Arguments

obj

an itrackR object

eyedata

type of eyetracking data to include. Can be:

  • 'fixations' (default). Fixation start/end times and x/y coordinates

  • 'saccades' Saccade start/end times and star/end x/y coordinates

  • 'blinks' Blink start/end times

  • 'epoched_fixations' fixation data epoched around some event using epoch_fixations

behdata

list of variables from obj$beh to include in the output (default = 'all').

all.rois

whether to include hits/misses for all rois in itrackR object (default = FALSE).

event

the timelocking event when getting epoched fixations

roi

the roi when getting epoched fixations

trialtime

whether to convert fixation/saccade times relative to the current trial, or leave relative to whole experiment.

condition

subset data according to some behavioral variables. Can use unquoted variable names as in subset. (e.g., condition = Block <= 5)

condition.str

whether the condition is saved as a string ('Block <= 5'). Used internally.

Value

returns a data frame with the variables from obj$beh merged with the eyetracking data requested. Merging is based on ID, and obj$indexvars. This corresponds to obj$beh$eyetrial as well.

See Also

epoch_fixations set_index

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
# itrackr.data('edfs') returns full path to 2 edf files
z <- itrackr(edfs=itrackr.data('edfs'))

#Extracts messages like "BLOCK 1", and "TRIAL 7" and creates variables "Block" and "Trial", giving them values
# 1 and 7.
z <- set_index(z,c('Block', 'Trial'), patterns=c('BLOCK [0-9]*', 'TRIAL [0-9][0-9]*), numeric.only = TRUE)

beh <- itrackr.data('beh)

z <- add_behdata(z,beh)

#get fixation data
fixes <- eyemerge(z,'fixations')

#get data only when Task==2
fixes <- eyemerge(z, 'fixations', condition = Task==2)

#saccades
saccs <- eyemerge(z,'saccades')


## End(Not run)

jashubbard/itrackR documentation built on May 18, 2019, 4:53 p.m.