Description Usage Arguments Details Value Author(s) References See Also Examples
Add a small amount of noise to a numeric vector.
1 |
x |
numeric vector to which jitter should be added. |
factor |
numeric. |
amount |
numeric; if positive, used as amount (see below),
otherwise, if Default ( |
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 positive
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 adjacent unique (apart from fuzz) x
values.
jitter(x, ...)
returns a numeric of the same length as
x
, but with an amount
of noise added in order to break
ties.
Werner Stahel and Martin Maechler, ETH Zurich
Chambers, J. M., Cleveland, W. S., Kleiner, B. and Tukey, P.A. (1983) Graphical Methods for Data Analysis. Wadsworth; figures 2.8, 4.22, 5.4.
Chambers, J. M. and Hastie, T. J. (1992) Statistical Models in S. Wadsworth & Brooks/Cole.
rug
which you may want to combine with jitter
.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.