Answers for "reorder columns in r"

R
0

reorder columns in r

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)]
Posted by: Guest on February-27-2020

Browse Popular Code Answers by Language