% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/PreprocessingFunctions.R
\name{calculate_rms}
\alias{calculate_rms}
\title{Calculate sample-to-sample root mean squared deviations (RMS) of subsequent samples in a data segment}
\usage{
calculate_rms(gaze_in, xcol = "x.raw", ycol = "y.raw", one_degree = 40)
}
\arguments{
\item{gaze_in}{data frame with gaze to process. Must contain the variables specified in the parameters 'xcol' and 'ycol'}

\item{xcol}{Name of column containing x coordinates}

\item{ycol}{Name of column containing y coordinates}

\item{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
}
\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.
}
\examples{
rms <- calculate_rms(sample.data.unprocessed)
}
