trend_line_outliers_to_na: Trend line outliers to missing.

Description Usage Arguments Examples

View source: R/trend_line_outliers_to_na.R

Description

trend_line_outliers_to_na determines outliers based on deviations from a smooth trend line and sets the outliers to missing (NA).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
trend_line_outliers_to_na(
  pupil,
  time = NULL,
  constant = 10,
  method = "low pass",
  sampling_frequency = 60,
  cutoff_frequency = 10,
  padding = 50,
  interpolation = "linear",
  log = FALSE,
  log_file = NULL
)

Arguments

pupil

A numeric vector of pupil size measurements.

time

A vector containing the timestamps associated with the pupil size measurements.

constant

A numeric value specifying the threshold for outlier removal.

log

A logical value. Should the action and results be logged?

log_file

A character string specifying the path to the log file.

span

A numeric value specifying the amount of smoothing.

Examples

1
2
3
4
5
6
library(dplyr)

blink <- mutate(blink,
    pupil_left = trend_line_outliers_to_na(pupil_left, timestamp),
    pupil_right = trend_line_outliers_to_na(pupil_right, timestamp)
  )

WillemSleegers/eyepatch documentation built on Aug. 2, 2021, 8:39 a.m.