📜  重新排序列 - R 编程语言代码示例

📅  最后修改于: 2022-03-11 14:52:00.008000             🧑  作者: Mango

代码示例1
col_order <- c("Species", "Petal.Width", "Sepal.Length",
               "Sepal.Width", "Petal.Length")
my_data2 <- my_data[, col_order]
my_data2

# or
my_data2 <- my_data[, c(5, 4, 1, 2, 3)]