View source: R/rowid_matrix_to_df.R
rowid_matrix_to_df | R Documentation |
Similar to tibble::rowid_to_column but also converting matrix to dataframe. It can also take lists of matrix/dataframes.
rowid_matrix_to_df(x, colname = "rownames")
x |
The object(s) with row IDs to be converted to dataframes |
colname |
The column name that will contain the row names |
mdat <- matrix(c(1, 2, "A", "B"), nrow = 2, ncol = 2, byrow = TRUE, dimnames = list(c("row1", "row2"), c("col1", "col2"))) rowid_matrix_to_df(mdat, colname = "row")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.