Skip to contents

Linearly detrend_pupil data by fitting a linear model of pupil_data ~ time, and return the fitted betas and the residuals (pupil_data - fitted_values).

Usage

detrend(eyeris)

Arguments

eyeris

An object of class eyeris dervived from load().

Value

An eyeris object with two new columns in timeseries: detrend_fitted_betas, and pupil_raw_{...}_detrend.

Examples

system.file("extdata", "memory.asc", package = "eyeris") |>
  eyeris::load_asc() |>
  eyeris::deblink(extend = 50) |>
  eyeris::detransient() |>
  eyeris::interpolate() |>
  eyeris::lpfilt(plot_freqz = TRUE) |>
  eyeris::detrend() |>
  plot(seed = 0)