powered by
convert a matrix to a tidy data frame (from wide to long format as described in the tidyverse concept)
mat2df(x)
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
the input matrix
Guangchuang Yu
x <- matrix(1:15, nrow = 3) mat2df(x)
Run the code above in your browser using DataLab