eye_average: average left and right eye gaze points

Usage Arguments Examples

Usage

1

Arguments

data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (data) 
{
    data$GazePointX <- rep(NA, nrow(data))
    data$GazePointY <- rep(NA, nrow(data))
    data$EyeLocX <- rep(NA, nrow(data))
    data$EyeLocY <- rep(NA, nrow(data))
    data$EyeLocZ <- rep(NA, nrow(data))
    for (i in 1:nrow(data)) {
        if (!is.na(data$Validity[i])) {
            data$GazePointX[i] <- (data$GazePointXLeft[i] + data$GazePointXRight[i])/2
            data$GazePointY[i] <- (data$GazePointYLeft[i] + data$GazePointYRight[i])/2
            data$EyeLocX[i] <- (data$EyeLocXLeft[i] + data$EyeLocXRight[i])/2
            data$EyeLocY[i] <- (data$EyeLocYLeft[i] + data$EyeLocYRight[i])/2
            data$EyeLocZ[i] <- (data$EyeLocZLeft[i] + data$EyeLocZRight[i])/2
        }
    }
    return(data)
  }

rwoldford/EyeFixR documentation built on May 12, 2019, 4:37 a.m.