Description Usage Arguments Examples
View source: R/trim_outliers.R
Remove outliers by either choosing a vector of column names to include for consideration or choosing a vector for exclusion. Either include or exclude must be non-NULL (not neither and not both).
1 2 | trim_outliers(df, cutoff = 1.96, exclude = NULL, include = NULL,
keep_scaled = TRUE)
|
df |
A dataframe. |
cutoff |
A numeric standard deviation cutoff value. |
exclude |
Vector of variables not to subject to cutting off. |
include |
Vector of variables to subject to cutting off. |
keep_scaled |
Should the newly scaled numeric variables be kept in the output? |
1 2 3 4 5 6 7 8 9 10 11 12 13 | trim_outliers(iris, cutoff = 1,
exclude = c("Species", "Sepal.Length"), keep_scaled = FALSE)
trim_outliers(iris, cutoff = 2,
include = c("Petal.Width", "Sepal.Length"), keep_scaled = TRUE)
# Error -- exclude and include can't both be non-NULL
testthat::expect_error(
trim_outliers(iris, cutoff = 2, exclude = "Species",
include = c("Petal.Width", "Sepal.Length"), keep_scaled = TRUE))
# Error -- exclude and include can't both be NULL
testthat::expect_error(
trim_outliers(iris, cutoff = 2, keep_scaled = TRUE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.