unwrap.matrix | R Documentation |
Convert between a matrix and a long-format data.frame
unwrap.matrix(x)
rewrap.matrix(x, na.value = NA)
x |
In case of |
na.value |
Which value to use in the matrix for elements
not provided in |
unwrap.matrix()
returns a data.frame
with three columns:
row
and col
indicating the row and column names, and
value
indicating the respective value in the matrix.
If no row or column names are available,
the row or column number is used instead.
rewrap.matrix()
returns a matrix.
Sercan Kahveci
mymatrix <- matrix(1:40,ncol=8,nrow=5)
unwrap.matrix(mymatrix)
rewrap.matrix(unwrap.matrix(mymatrix))
carmatrix <- as.matrix(mtcars)
unwrap.matrix(carmatrix)
rewrap.matrix(unwrap.matrix(carmatrix))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.