jitter_min | R Documentation |
Add a small amount of noise to a numeric vector. The result is x + runif(n, -a, a)
where n <- length(x)
and a <- abs(factor*amount)
argument. If amount==0
then amount
is set to 1e-6
times the smallest non-zero distance between adjacent unique x
values.
In case of no non-zero distances amount
is set to 1e-6*(1+min(abs(x)))
.
Note that jitter_min
delivers different results then base::jitter.
jitter_min(x, factor = 1, amount = 0)
x |
numeric: vector to which jitter should be added |
factor |
numeric: multiplier for |
amount |
numeric: amount for jittering (default: |
jittered data
jitter_min(runif(6)) jitter_min(rep(0, 7)) jitter_min(rep(10000, 5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.