melt_matrix | R Documentation |
melt_matrix()
takes a matrix as input, which has the shape of a contingency table.
Hence, the row and column names/indices are considered as unique values of a
(categorical) variable and the cells represent values associated with the
respective row-column combinations.
The function then transforms the data to a long data.table representation.
melt_matrix(x, name_row = "row", name_col = "column", name_val = "value")
x |
( |
name_row |
( |
name_col |
( |
name_val |
( |
(data.table::data.table()
)
A data.table
representing x
in a long format.
If the supplied matrix does not have row and/or column names, it will be supplied
with the matching indices.
The columns of the data.table created from the row and column names are always
of type "character".
If a type conversion is desired, this has to be done by the
user afterwards manually.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.