rrange                package:sfsmisc                R Documentation

_R_o_b_u_s_t _R_a_n_g_e _u_s_i_n_g _B_o_x_p_l_o_t '_Q_u_a_r_t_i_l_e_s'

_D_e_s_c_r_i_p_t_i_o_n:

     Compute a robust range, i.e. the usual 'range()' as long as there
     are no outliers,  using the ``whisker boundaries'' of 'boxplot'.

_U_s_a_g_e:

     rrange(x, range=1, coef = 1.5, na.rm = TRUE)

_A_r_g_u_m_e_n_t_s:

       x: numeric vector the robust range of which shall be computed.

   range: number for S compatibility; '1.5 * range' is equivalent to
          'coef'.

    coef: numeric multiplication factor definying the outlier boundary,
          see ``Details'' below.

   na.rm: logical indicating how 'NA' values should be handled;  they
          are simply dropped when 'na.rm = TRUE' as by default.

_D_e_t_a_i_l_s:

     The robust range is really just what 'boxplot.stats(x, coef=coef)'
     returns as the whisker boundaries. This is the most extreme values
     'x[j]' still inside median plus/minus 'coef * IQR'.

_V_a_l_u_e:

     numeric vector 'c(m,M)' with m <= M which is (not strictly) inside
     'range(x) = c(min(x),max(x))'.

_A_u_t_h_o_r(_s):

     Martin Maechler, 1990.

_S_e_e _A_l_s_o:

     'range', 'fivenum', 'boxplot'.

_E_x_a_m_p_l_e_s:

     stopifnot(rrange(c(1:10,1000)) == c(1,10))

