split_mat | R Documentation |
split.data.frame method from base R actually does the job. The name is very intuitive though and by default it only splits along rows. For splitting by column two transposations would be needed which is not very elegant in case of large matrices. So here you can define if you want to split the matrix along its rows or columns.
split_mat(x, f, byrow = T, ...)
x |
a matrix |
f |
a character or factor vector for splitting |
byrow |
split by rows (T) or by columns (F) |
... |
arguments passed to split |
a list of length unique(f) of splitted matrices in returned
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.