function that shifts vector values to right or left
shift(x, n = 0, default = NA, invert = FALSE)
Vector for which to shift values
Number of places to be shifted. Positive numbers will shift to the right by default. Negative numbers will shift to the left by default. The direction can be inverted by the invert parameter.
The value that should be inserted by default.
Whether or not the default shift directions should be inverted.