Skip to contents

Computes cyclopean samples by averaging over binocular recorded properties such as pxL/pxR, pyL/pyR, hxL/hxR, etc. Uses function specified via fun parameter to compute the average with na.rm = TRUE option. In case of a monocular recording or when the information from one eye missing, uses information from one eye only, ignoring the other column. In both binocular and monocular recording cases, simplifies column names so that pxL and/or pxR are replaced with a single column px, pyL/pyR with py, etc.

Usage

compute_cyclopean_samples(object, fun = mean)

# S3 method for data.frame
compute_cyclopean_samples(object, fun = mean)

# S3 method for eyelinkRecording
compute_cyclopean_samples(object, fun = mean)

Arguments

object

Either an eyelinkRecording object or data.frame with samples, i.e., samples slot of the eyelinkRecording object.

fun

Function used to average across eyes, defaults to mean.

Value

Object of the same time as input, i.e., either a eyelinkRecording object with modified

samples slot or a data.frame with cyclopean samples.

Examples

data(gaze)

# by passing samples table
cyclopean_samples <- compute_cyclopean_samples(gaze$samples)

# storing cyclopean samples as a separate table in recording
gaze$cyclopean_samples <- compute_cyclopean_samples(gaze$samples)

# by passing the recording, cyclopean samples replace original ones
gaze <- compute_cyclopean_samples(gaze)