split_mat: Split matrices just like splitting a data frame.

View source: R/split_mat.R

split_matR Documentation

Split matrices just like splitting a data frame.

Description

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.

Usage

split_mat(x, f, byrow = T, ...)

Arguments

x

a matrix

f

a character or factor vector for splitting

byrow

split by rows (T) or by columns (F)

...

arguments passed to split

Value

a list of length unique(f) of splitted matrices in returned


Close-your-eyes/fcexpr documentation built on Sept. 29, 2023, 12:27 a.m.