Answers for "how to make a column row names in r"

R
0

how to set the first column as row names in r

df2 <- df[,-1]
rownames(df2) <- df[,1]
Posted by: Guest on May-27-2021
0

turn row names into column in r

library("dplyr")
data <- tibble::rownames_to_column(data, "row_names")  # Apply rownames_to_column
data                                                   # Print updated data
#   row_names x1 x2
# 1         1  A  e
# 2         2  B  d
# 3         3  C  c
Posted by: Guest on April-08-2021

Code answers related to "how to make a column row names in r"

Browse Popular Code Answers by Language