I would like to have the last column of the data frame moved to the start (as first column). How can I do it in R?
My data.frame has about a thousand columns to chan
Move any column from any position for the first position in your data
n <- which(colnames(df)=="column_need_move") column_need_move <- df$column_need_to_move df <- cbind(column_need_move, df[,-n])