winsorize | R Documentation |
Replaces the values in a numeric vector that are beyond the specified
quantiles with the boundary values of those quantiles. This is done for both
tails of the distribution based on the cut
parameter.
winsorize(x, cut)
x |
A numeric vector to be winsorized. |
cut |
The proportion of data to be winsorized from both ends of the
distribution. For example, a |
A numeric vector with the extreme values replaced by the corresponding quantile values.
set.seed(123)
data <- rnorm(100)
winsorized_data <- winsorize(data, 0.05)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.