powered by
Function for reordering columns
reorderColumns(data, vars)
The same data.frame specified in data, with ordered columns.
data.frame
data
A data.frame
Named vector indicating the position in the data frame of the specified variable
someData <- data.frame( "Col1" = c(1, 2), "Col2" = c(2, 3), "Col3" = c(3, 4) ) reorderColumns( data = someData, vars = c("Col3" = 1) )
Run the code above in your browser using DataLab