powered by
Converts all columns to numeric and uses the row identifier column (id_var) as row names.
id_var
encode_as_num_mat(data, id_var)
Numeric matrix with id_var values as row names
A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr).
An unquoted expression which corresponds to a variable in data which identifies each row.
data
require(dplyr) require(magrittr) mtcars %>% dplyr::as_tibble(rownames = "id") %>% encode_as_num_mat(id)
Run the code above in your browser using DataLab