Description Usage Arguments Details Value Author(s) Examples
Split a matrix by rows or columns into a list.
1 | split_matrix(x, by = c("row", "col"))
|
x |
A matrix to by split |
Either |
|
A shorthand not preserving rownames is split(x, row(x))
for splitting by rows and split(x, col(x))
for splitting by
columns.
A list containing the row or columns of the matrix.
Dominik Mueller
1 2 3 4 | x <- matrix(seq_len(4L), nrow = 2L)
dimnames(x) <- list(c('a', 'b'), c('c', 'd'))
split_matrix(x, 'row')
split_matrix(x, 'col')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.