I have a vector:
a <- c(1,2,3,4,5)
And I\'d like to do something like:
b <- roll(a, 2) # 4,5,1,2,3
Is t
The package binhf has the function shift:
library(binhf) shift(1:5, places = 2) #[1] 4 5 1 2 3
places can be positive or negative