how to set the first column as row names in r
df2 <- df[,-1]
rownames(df2) <- df[,1]
how to set the first column as row names in r
df2 <- df[,-1]
rownames(df2) <- df[,1]
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
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us