Description Usage Arguments Details Examples
View source: R/outliers-multivar.r
Performs multivariate outlier detection using Local Outlier Factor algorithm.
1 2 3 4 5 6 7 |
xs |
A dataframe or list of vectors (which will be coerced to a numeric matrix). |
mask |
A logical vector that defines which values in |
threshold |
A length-two vector identifying thresholds for "mild" and "extreme" outliers. |
return.score |
if |
... |
Additional arguments to |
the values of threshold
identify mild and extreme
outliers based on the LOF score. Scores significantly larger
than 1 indicate outliers. Default values are 1.5 for "mild"
outliers and 2.0 for "extreme" outliers.
1 2 3 4 5 6 7 8 9 10 11 | x = seq(0, 34, by = 0.25)*pi
noise = rlnorm(length(x), meanlog = 1, sdlog = 3)
y=sin(x) + noise
mask = noise < 1
if (requireNamespace("dbscan", quietly = TRUE)) {
moutlier_lof(list(y))
moutlier_lof(list(x, y), mask)
moutlier_lof(list(x, y), mask, threshold = c(1, 2))
moutlier_lof(list(x, y), return.score = TRUE)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.