powered by
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.
exactly()
chop(x, c(1, exactly(2), 3))
chop(x, c(1, 2, 2, 3))
exactly(x)
The same as rep(x, each = 2).
rep(x, each = 2)
A numeric vector.
chop(1:10, c(2, exactly(5), 8)) # same: chop(1:10, c(2, 5, 5, 8))
Run the code above in your browser using DataLab