Description Usage Arguments Examples
Spread out the values of a numeric vector
1 2 | spread_seq(x, f = 1.1, ..., node = c("midrange", "first", "last",
"mean", "median", "min", "max"))
|
x |
a numeric vector |
f |
numeric or item matching a function. If numeric, a multiplicative factor applied to the distance between points, otherwise a function to be applied to differences |
... |
further arguments passed to |
node |
the location of |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | x <- c(-1, 0, 2, NA, 4, 5, 6, 8, 9)
spread_seq(c(-1, 1))
spread_seq(x, 1.5, "midrange")
spread_seq(x, 1.5, "first")
spread_seq(x, 1.5, "last")
spread_seq(x, 1.5, "mean")
spread_seq(x, 1.5, "median")
spread_seq(c(3, 4, 1, 9, 6))
spread_seq(c(3, 4, 1, 9, 6), 2, "min")
spread_seq(c(3, 4, 1, 9, 6), 2, "max")
spread_seq(c(3, 4, 1, 9, 6), "/", 2)
spread_seq(c(3, 4, 1, 9, 6), 0.5)
y <- sort(c(3, 4, 1, 9, 6))
plot(y)
lines(spread_seq(y, "log1p"))
f <- function(x) sqrt(abs(x)*2)*sign(x)
y <- c(3, 4, 1, 9, 6)
plot(y)
lines(spread_seq(y, f=f))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.