cleanOutliers | R Documentation |
Outliers are "cleaned" by shrinking or rejecting data whose distance from the median (med) is larger in absolute value than a specified value k multiplied by the median absolute deviation from the median (mad). Outlier shrinkage results in the data value being set equal to the nearest of med-k*mad and med+k*mad. Rejected data is assigned an NA. Shrinkage is the default.
cleanOutliers(x, k = 3, shrink = TRUE)
x |
A numeric vector |
k |
A numeric value, which multiplies the mad. Smaller values of k result in greater fractions of data which is either shrunk of rejected, and larger values of k result in smaller fractions of the data that are shrunk or rejected. |
shrink |
A logical variable whose default is TRUE. |
an outlier cleaned numeric object
args(cleanOutliers)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.