shift.column | R Documentation |
Shift a column of data
shift.column(data, columns, newNames = sprintf("%s.Shifted", columns),
len = 1L, up = TRUE)
data |
|
columns |
Character vector specifying which columns to shift. |
newNames |
Character vector specifying new names for the columns that will be created by the shift. Must be same length as |
len |
Integer specifying how many rows to shift the data. |
up |
logical indicating if rows should be shifted up or down. |
Shifts a column of data up or down a certain number of rows
data.frame
with the specified columns shifted.
Jared P. Lander
myData <- data.frame(Upper=LETTERS, lower=letters)
shift.column(data=myData, columns="lower")
shift.column(data=myData, columns="lower", len=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.