Move a column to first position in a data frame

前端 未结 8 1542
别那么骄傲
别那么骄傲 2020-12-22 23:30

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

8条回答
  •  不知归路
    2020-12-23 00:00

    dataframe<-dataframe[,c(1000, 1:999)]
    

    this will move your last column i.e. 1000th column to the first column.

提交回复
热议问题