calculate_rms: Calculate sample-to-sample root mean squared deviations (RMS)...

View source: R/PreprocessingFunctions.R

calculate_rmsR Documentation

Calculate sample-to-sample root mean squared deviations (RMS) of subsequent samples in a data segment

Description

Calculate the RMS of a gaze segment with X and Y coordinates. RMS is inversely related to precision, so that lower RMS indicates higher precision calculate_rms calculates the root mean square of the Euclidean distance in degrees between subsequent samples Adjust the parameters 'xcol' and 'ycol' to specify the data you want to work with. For example, it is possible to calculate the RMS of the left and right eye separately by specifying appropriate columns. The result is expressed in degrees of the visual field. Specify this unit by changing the parameter one_degree. The default value is 40 and assumes that the X and Y coordinates are expressed in pixels on the built-in screen of a Tobii Pro Spectrum Eye tracker. This value should be adapted to the set up and unit of the X and Y coordinates in the data set. Note that RMS values for each fixation are also returned by all fixation detection algorithms in kollaR, calculate_rms can be used to calculate the RMS for a whole recording or a specific data segment.

Usage

calculate_rms(gaze_in, xcol = "x.raw", ycol = "y.raw", one_degree = 40)

Arguments

gaze_in

data frame with gaze to process. Must contain the variables specified in the parameters 'xcol' and 'ycol'

xcol

Name of column containing x coordinates

ycol

Name of column containing y coordinates

one_degree

One degree of the visual field in the units of the X and Y coordinates as specified in 'xcol' and 'ycol'

Value

sample-to-sample RMS

Examples

rms <- calculate_rms(sample.data.unprocessed)

kollaR documentation built on May 8, 2026, 5:07 p.m.