interpolate_NAs: Interpolation for missing data.

Description Usage Arguments Value Examples

View source: R/process.R

Description

interpolate_NAs performs interpolation of missing data for the pupil and gaze coordinates (if desired).

Usage

1
2
interpolate_NAs(data = data, Method = "linear", XandY = TRUE,
  MinData = 2)

Arguments

data

A data frame object created from auto_cleanup.

Method

A character string indicating type of interpolation ("linear" or "spline") as implemented in na.approx.

XandY

A logical specifying if interpolation should also be done on gaze coordinates

MinData

A number indicating the minimum number of data points required in order for interpolation to be applied to the event.

Value

An object of type data table as described in tibble.

Examples

1
2
3
4
5
6
7
8
# Load example data
data("Pupilex4")

dat <- interpolate_NAs(Pupilex4, Method = "linear",
                       XandY = TRUE, MinData = 2)

# Please see the vignettes for detailed example usage.
# vignette("PupilPre_Interpolation_and_Filtering", package="PupilPre")

PupilPre documentation built on March 14, 2020, 1:08 a.m.