Description Usage Arguments Value
View source: R/spare_matrix_to_tidy_df.R
Tidy a sparse matrix
1 2 3 4 5 6 7 | sparse_matrix_to_tidy(
sparse_mat,
rows_id = "x",
cols_id = "y",
values_id = "value",
keep_values = TRUE
)
|
sparse_mat |
Sparse matrix of class |
rows_id |
What is stored in the rows of matrix |
cols_id |
What is stored in the columns on matrix |
values_id |
What the values in the cells are |
keep_values |
Do you want to keep the values of the cells or is the matrix a binary one where just existance matters? |
Tidy df with a row for each non-empty entry in the sparse matrix. If keep_values == TRUE
then there will be a third column containing the value of cell in matrix at pairing.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.