Debian Codegraph @

man/rrange.Rd

raw
1 \name{rrange}
2 \alias{rrange}
3 \title{Robust Range using Boxplot 'Quartiles'}
4 \description{
5 Compute a robust range, i.e. the usual \code{\link{range}()} as long
6 as there are no outliers, using the \dQuote{whisker boundaries} of
7 \code{\link{boxplot}}, i.e., \code{\link{boxplot.stats}}.
8 }
9 \usage{
10 rrange(x, range=1, coef = 1.5, na.rm = TRUE)
11 }
12 \arguments{
13 \item{x}{numeric vector the robust range of which shall be computed.}
14 \item{range}{number for S compatibility; \code{1.5 * range} is
15 equivalent to \code{coef}.}
16 \item{coef}{numeric multiplication factor definying the outlier
17 boundary, see \sQuote{Details} below.}
18 \item{na.rm}{logical indicating how \code{\link{NA}} values should be
19 handled; they are simply dropped when \code{na.rm = TRUE} as by default.}
20 }
21 \details{
22 The robust range is really just what \code{\link{boxplot.stats}(x,
23 coef=coef)} returns as the whisker boundaries.
24 This is the most extreme values \code{x[j]} still inside median
25 plus/minus \code{coef * IQR}.
26 }
27 \value{
28 numeric vector \code{c(m,M)} with \eqn{m \le M}{m <= M} which is (not
29 strictly) inside \code{range(x) = c(min(x),max(x))}.
30 }
31 \author{Martin Maechler, 1990.}
32 \seealso{\code{\link{range}}, \code{\link{fivenum}},
33 \code{\link{boxplot}} and \code{\link{boxplot.stats}}.
34
35 A more sophisticated robust range for (strongly) asymmetric data can
36 be derived from the skewness adjusted boxplot statistics
37 \code{\link[robustbase]{adjboxStats}} which is a generalization of
38 \code{\link{boxplot.stats}}.
39 }
40 \examples{
41 stopifnot(rrange(c(1:10,1000)) == c(1,10))
42 }
43 \keyword{univar}
44 \keyword{robust}