I want to convert a tibble into a matrix with the first column of the tibble as row names of the matrix.
Currently I'm doing like this:
my_tibble = tibble(row_name = letters[1:10], a = 1:10, b = 11:20, c = 21:30) row_name = my_tibble$row_name my_tibble %<>% select(-row_name) %>% as.matrix rownames(my_tibble) = row_name
Is there a pre-built
tidyverse function for this job?