This function will replace outliers based on a z-score cutoff

replace_outliers(
  x,
  variables = c(),
  cutoff = 3.5,
  with = "NA",
  id = "Subject",
  log_file = NULL
)

Arguments

x

dataframe

variables

variables c() to be trimmed

cutoff

z-score cutoff to use for trimming (default: 3.5)

with

What value should the trimmed values be replaced with. (default: replace = "NA")

id

If variables = "all", then need to supply the subject ID variable

log_file

the file path and name for where to save a log file to