changing row names in r code example
Example 1: set row names in r
row.names(x) <- value
Example 2: turn row names into column in r
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