Description Usage Arguments Value Examples
Make a vector unique
1 2 3 | make.unique.approx(x, ...)
## Default S3 method:
make.unique.approx(x, quantile = 0:1, ...)
|
x |
Vector. Vector of a class which has differences that can be coerced to numeric for which the difference, when added to the first value, returns the second value. |
quantile |
A number between 0 and 1 (or vector of numbers)
such that if it is 0 then
the first time value among duplicates is kept as is and the others
calculated via linear interpolation or if 1 then the last time value is
kept as is and the others calculated via linear interpolation. If
an intermediate fraction is used then that quantile is kept as is.
If a vector of numbers is specified then they are applied in succession.
0 will not remove duplicates at the end and 1 will not remove trailing
duplicates at the beginning but |
... |
Further arguments. |
The function returns x
except among any set of repeated elements
the one at the position whose quantile is indicated is left as is and
all others are linearly interpolated.
1 2 | xx <- c(10, rep(20, 10), 30)
make.unique.approx(xx)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.