| exactly {santoku} | R Documentation |
Define singleton intervals explicitly
Description
exactly() duplicates its input.
It lets you define singleton intervals like this: chop(x, c(1, exactly(2), 3)).
This is the same as chop(x, c(1, 2, 2, 3)) but conveys your intent more
clearly.
Usage
exactly(x)
Arguments
x |
A numeric vector. |
Value
The same as rep(x, each = 2).
Examples
chop(1:10, c(2, exactly(5), 8))
# same:
chop(1:10, c(2, 5, 5, 8))
[Package santoku version 1.0.0 Index]