

jitter {base}                                R Documentation

_A_d_d _`_J_i_t_t_e_r_' _(_N_o_i_s_e_) _t_o _N_u_m_b_e_r_s

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

     Add a small amount of noise to a numeric vector.

_U_s_a_g_e_:

     jitter(x, factor=1, amount = NULL)

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

     The result, say `r', is `r <- x + runif(n, -a, a)'
     where `n <- length(x)' and `a' is the `amount' argument
     (if specified).

     Let `z <- max(x) - min(x)' (assuming the usual case).
     The amount `a' to be added is either provided as posi-
     tive argument `amount' or otherwise computed from `z',
     as follows:

     If `amount == 0', we set `a <- factor * z/50' (same as
     S).

     If `amount' is `NULL' (default), we set `a <- factor *
     d/5' where d is the smallest difference between adja-
     cent unique (apart from fuzz) `x' values.

_V_a_l_u_e_:

     `jitter(x,...)' returns a numeric of the same length as
     `x', but with an `amount' of noise added in order to
     break ties.

_A_u_t_h_o_r_(_s_)_:

     Werner Stahel and Martin Maechler, ETH Zurich

_R_e_f_e_r_e_n_c_e_s_:

     Chambers, J.M., Cleveland, W.~S., Kleiner, B. and
     Tukey, P.A. (1983).  Graphical Methods for Data Analy-
     sis, Wadsworth; figures 2.8, 4.22, 5.4.

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

     `rug' which you may want to combine with `jitter'.

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

     round(jitter(c(rep(1,3),  rep(1.2, 4), rep(3,3))), 3)
     ## These two `fail' with S-plus 3.x:
     jitter(rep(0, 7))
     jitter(rep(10000,5))

