outlier2na | R Documentation |
This is a wrapper function around tsOutliers
that automatically
removes identified statistical outliers from a measurement series.
outlier2na(val, lower_quantile = 0.2, upper_quantile = 0.8, ...)
val |
Numeric. A vector of observed time-series values. |
lower_quantile |
Numeric, default is 0.2. The lower quantile limit. |
upper_quantile |
Numeric, default is 0.8. The upper quantile limit. |
... |
Additional arguments passed to |
An outlier-cleaned numeric vector of time-series values.
Florian Detsch
tsOutliers
# Random time-series values
set.seed(10)
x <- rnorm(100, 0, 2)
# Replace outliers with NA
x2 <- outlier2na(x, lower_quantile = .35, upper_quantile = .7)
plot(x, type = "l", lty = 2)
lines(x2, col = "red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.