flatten | R Documentation |
Flatten (i.e., collapse) a matrix or array to one dimension.
flatten(x, across = c("rows", "columns"))
x |
A matrix. |
across |
Character string specifying whether to flatten the matrix
across |
A numeric vector.
mat.
m <- mat("2, 4, 6, 8; 10, 12, 14, 16")
flatten(m)
flatten(m, across = "columns")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.