# NOT RUN {
set.seed(1234)     
x <- rnorm(100)     
x[1] <- x[1] * 10  
winsorize(x)       
plot(x, type="l")
  lines(winsorize(x), col="red", lwd=2)
# Behavior with NA value(s)
x[4] <- NA
winsorize(x)             # returns x with original NA's 
winsorize(x, na.rm=TRUE) # removes NA's 
# }
Run the code above in your browser using DataLab