Once data is smoothed, it is important to deal with missing observations, such as blinks. This allows simple interpolation over missing values, either linear, or cubic. Depending on the analysis planed, this may not be a necessary option, but it is strongly recommended for the functional analyses planned in this package.
interpolate_data(data, pupil, type = c("linear", "cubic"))
a PupillometryR dataframe
Column name for pupil data to be interpolated
string indicating linear or cubic interpolation to be performed.
interpolated pupillometry data
Sdata <- make_pupillometryr_data(data = pupil_data,
subject = ID,
trial = Trial,
time = Time,
condition = Type)
mean_data <- calculate_mean_pupil_size(data = Sdata,
pupil1 = RPupil, pupil2 = LPupil)
filtered_data <- filter_data(data = mean_data,
pupil = mean_pupil,
filter = 'hanning',
degree = 11)
#> Performing hanning filter
int_data <- interpolate_data(data = filtered_data,
pupil = mean_pupil,
type = 'linear')
#> Performing linear interpolation