# Example: 100 is an outlier
df <- data.frame(val = c(1, 2, 3, 2, 1, 100))
# The 100 will be replaced by the maximum allowed IQR value
clean_df <- treat_outliers(df, "val", method = "iqr")
print(clean_df$val)
Run the code above in your browser using DataLab