encode_as_num_mat {eHDPrep} | R Documentation |
Converts all columns to numeric and uses the row identifier column
(id_var
) as row names.
encode_as_num_mat(data, id_var)
data |
A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). |
id_var |
An unquoted expression which corresponds to a variable in
|
Numeric matrix with id_var
values as row names
require(dplyr)
require(magrittr)
mtcars %>%
dplyr::as_tibble(rownames = "id") %>%
encode_as_num_mat(id)