outlier               package:outliers               R Documentation

_F_i_n_d _v_a_l_u_e _w_i_t_h _l_a_r_g_e_s_t _d_i_f_f_e_r_e_n_c_e _f_r_o_m _t_h_e _m_e_a_n

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

     Finds value with largest difference between it and sample mean,
     which can be an outlier.

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

     outlier(x, opposite = FALSE, logical = FALSE)

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

       x: a data sample, vector in most cases. If argument is a
          dataframe, then outlier is calculated for each column by
          'sapply'. The same behavior is applied by 'apply' when the
          matrix is given. 

opposite: if set to TRUE, gives opposite value (if largest value has
          maximum difference from the mean, it gives smallest and vice
          versa)

 logical: if set to TRUE, gives vector of logical values, and possible
          outlier position is marked by TRUE

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

     A vector of value(s) with largest difference from the mean.

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

     Lukasz Komsta

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

     'rm.outlier'

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

     set.seed(1234)
     y=rnorm(100)
     outlier(y)
     outlier(y,opposite=TRUE)
     dim(y) <- c(20,5)
     outlier(y)
     outlier(y,opposite=TRUE)

