This function reliably unstacks a data frame into a matrix
1 |
df |
The input data.frame object |
row_id |
An integer indicating the column id which specifies the rows of the unstacked matrix |
col_id |
An integer indicating the column id which specifies the columns of the unstacked matrix |
value_id |
An integer indicating the column id which specifies the values to be filled in the unstacked matrix. |
na_value |
Specifies whether to replace NA values, such as from missing row/column combinations. Defaults to "NA" (no replacement). |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.