mat2df {yulab.utils} | R Documentation |
convert a matrix to a tidy data frame (from wide to long format as described in the tidyverse concept)
mat2df(x)
x |
the input matrix |
a data.frame in long format with the 'value' column stores the original values and 'row' and 'col' columns stored in row and column index as in x
Guangchuang Yu
x <- matrix(1:15, nrow = 3)
mat2df(x)