jitter(x, factor=1, amount=0)
amount
is positive then random uniforms between
-amount
and
amount
are added to the data. Otherwise
factor is used to compute the range of the random uniforms
based on the range of x.
x
with random noise added to each term. The
noise serves to separate points with identical values.
Jittering is a convenient technique for separating points for plotting.
The added noise is small compared with the range of the data, so the
overall plot shape is not changed, yet each point appears as a unique
dot.
If
amount
is not positive,
the added noise is generated by
runif
from a range depending on the range
of
x
and the scaling supplied by
factor
.
vec <- c(rep(1,2), rep(2,4), rep(3,4)) jitter(vec) [1] 1.000522 1.027184 1.994750 2.038981 1.961557 [6] 1.978223 2.973215 3.033884 2.962557 3.005580