R/Outlier_Process.R

# process the abnormal value

Outlier_Process <- function(x, na.rm = TRUE, ...){
  qnt <- quantile(x, probs=c(.25, .75), na.rm = na.rm, ...)
  H <- 1.5 * IQR(x, na.rm = na.rm)
  y <- x
  y[x < (qnt[1] - H)] <- NA
  y[x > (qnt[2] + H)] <- NA
  
  return(y)
}
iffylaw/PIC documentation built on May 8, 2019, 9:26 a.m.