Ubah nama baris menjadi kolom di r
d <- cbind(rownames(d), data.frame(d, row.names=NULL))
Grumpy Goose
d <- cbind(rownames(d), data.frame(d, row.names=NULL))
data$row_names <- row.names(data) # Apply row.names function
data # Print updated data
# x1 x2 row_names
# 1 A e 1
# 2 B d 2
library(tidyverse)
samp %>% remove_rownames %>% column_to_rownames(var="names")
> samp.with.rownames <- data.frame(samp[,-1], row.names=samp[,1])
samp2 <- samp[,-1]
rownames(samp2) <- samp[,1]