shiftData | R Documentation |
Returns a vector like the input, but with the position of the data shifted up or down.
shiftData(x, k = 1, fill = NA, circular = FALSE)
x |
any vector. |
k |
a positive or negative whole number of positions to shift the data. Positive values shift data to a higher position and negative values shift data to a lower position. |
fill |
a scalar value like |
circular |
logical ( |
A vector like x
, with data shifted in position.
lag
shiftData(1:5, k=1) # [1] NA 1 2 3 4 shiftData(1:5, k=1, circ=TRUE) # [1] 5 1 2 3 4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.