smoother: Smoothing of raw data

View source: R/smoother.R

smootherR Documentation

Smoothing of raw data

Description

A wrapper for the stats::loess function, with default parameters suitable for smoothing raw eye data

Usage

smoother(data, span = 0.1, plot = FALSE, participant_ID = "participant_ID")

Arguments

data

A dataframe with raw data (time, x, y, trial) for one participant

span

From stats::loess. The parameter alpha which controls the degree of smoothing.

plot

whether to plot the raw and smoothed plot for inspection

participant_ID

the variable that determines the participant identifier. If no column present, assumes a single participant

Details

It can take either single participant data or multiple participants where there is a variable for unique participant identification. The function looks for an identifier named participant_ID by default and will treat this as multiple-participant data as default, if not it is handled as single participant data, or the participant_ID needs to be specified

Value

a dataframe of the same shape as the input data

Examples

data <- combine_eyes(HCL)

smoother(data, participant_ID = "pNum")

#with an inspection plot
smoother(data, span = .02, participant_ID = "pNum", plot = TRUE)


tombeesley/eyetools documentation built on Dec. 23, 2024, 12:36 a.m.