Add a small amount of noise to a numeric vector.
jitter(x, factor = 1, amount = NULL)
| Parameter | Description |
|---|---|
x |
numeric vector to which jitter should be added. |
factor |
numeric. |
amount |
numeric; if positive, used as amount (see below), otherwise, if = 0 the default is factor * z/50. Default (NULL): factor * d/5 where d is about the smallest difference between x values. |
# NOT RUN {
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))
# }