R/rrange.R
raw| 1 | rrange <- function(x, range = 1, coef = 1.5, na.rm = TRUE) |
| 2 | { |
| 3 | ## Purpose: `Robust RANGE', ===> ?rrange |
| 4 | ## Author: Martin Maechler, 1990 |
| 5 | if(!missing(range)) { |
| 6 | if(!missing(coef)) stop("Must use either 'range' or 'coef'") |
| 7 | coef <- 1.5 * range |
| 8 | } |
| 9 | if(!na.rm && any(is.na(x))) |
| 10 | return(0+ c(NA,NA))# numeric NA |
| 11 | |
| 12 | ## S: (boxplot(..., plot = FALSE)$stats)[c(5, 1)] |
| 13 | boxplot.stats(x, coef = coef, do.conf= FALSE, do.out= FALSE)$stats[c(1,5)] |
| 14 | } |