read_gazedata: Load a '.gazedata' file for an experiment

Description Usage Arguments Details Value References

View source: R/gazedata.R

Description

Loads .gazedata file created by an Eprime experiment running on a Tobii eyetracker, and performs typical data reduction on that file.

Usage

1
2
3
4
5
6
read_gazedata(
  gazedata_path,
  eyes = "both",
  means_need_both = FALSE,
  apply_corrections = TRUE
)

Arguments

gazedata_path

path to the .gazedata file that is to be parsed.

eyes

string describing which eye(s) should be selected for the Mean columns. Valid options are "both", "left", and "right". Defaults to "both". If "left" is selected, then only the left eye is used to calculate the XMean, YMean, etc. columns.

means_need_both

logical value indicating if both eyes are required to compute Mean columns. Defaults to FALSE. If FALSE, NA values are ignored, so for example, XMean could be computed from an XLeft of .25 and an XRight of NA.

apply_corrections

whether to do low-level adjustments like coding offscreen looks as NA, negative pupil diameters to NA, negative distances to NA, and flip y-axis so the origin is the lower-left corner. Defaults to TRUE. Only used as FALSE in case "raw" data is needed.

Details

We extract the columns the following columns: TrialId, RTTime, XGazePosLeftEye, XGazePosRightEye, YGazePosLeftEye, YGazePosRightEye, DistanceLeftEye, DistanceRightEye, DiameterPupilLeftEye and DiameterPupilRightEye.

Once these column values are loaded, we make three modifications to the gazedata (when apply_corrections is TRUE).

  1. Gaze measurements with Validity codes greater than or equal to 1 are replaced with NA values.

  2. X,Y gaze values are defined in screen proportions. Values that fall outside [0,1] are outside of the boundaries of the screen and therefore are nonsensical. Replace them with NA. We perform a similar correction on pupil diameters and eye-distances by replacing negative values with NA.

  3. The origin of the screen is the upper-left-hand corner of the screen. Flip the y-values so that the origin is in a more familiar position in the lower-left-hand corner of the screen. This way, low y values are closer to the bottom of the screen.

  4. Compute the mean x, y, distance and diameter values for the left and right eyes. NA values are ignored when computing the mean, so the pair (XLeft = NA, XRight = .5) yields XMean = .5.

Value

A dataframe containing the parsed gazedata. Each row of the dataframe contains the eye-tracking data for a single frame of time recorded during the experiment.

References

Tobii Toolbox for Matlab: Product Description & User Guide


tjmahr/littlelisteners documentation built on June 3, 2021, 2:10 p.m.