powered by
Get matrix from tibble
as_matrix
as_matrix(.data, rownames = NULL, do_check = TRUE, sep_rownames = "___")# S4 method for spec_tbl_df as_matrix(.data, rownames = NULL, do_check = TRUE, sep_rownames = "___")# S4 method for tbl_df as_matrix(.data, rownames = NULL, do_check = TRUE, sep_rownames = "___")
# S4 method for spec_tbl_df as_matrix(.data, rownames = NULL, do_check = TRUE, sep_rownames = "___")
# S4 method for tbl_df as_matrix(.data, rownames = NULL, do_check = TRUE, sep_rownames = "___")
A tibble
A character string of the rownames
A boolean
A character with which multiple columns are united if rownames is a column array (e.g., rownames = c(col1, col2))
A matrix
A `tbl` with filled abundance
# NOT RUN { library(dplyr) library(tidyr) select(mtcars_tidy, car_model, feature, value) %>% spread(feature, value) %>% as_matrix(rownames = car_model) # }
Run the code above in your browser using DataLab