Converts a column to row names
Examples
x <- data.frame(
a = 1:4,
b = letters[1:4]
)
to_row_names(x)
#> b
#> 1 a
#> 2 b
#> 3 c
#> 4 d
to_row_names(x, "b")
#> a
#> a 1
#> b 2
#> c 3
#> d 4
Converts a column to row names
x <- data.frame(
a = 1:4,
b = letters[1:4]
)
to_row_names(x)
#> b
#> 1 a
#> 2 b
#> 3 c
#> 4 d
to_row_names(x, "b")
#> a
#> a 1
#> b 2
#> c 3
#> d 4