Description Usage Arguments Value
View source: R/merge_by_partition.R
Merge matrix rows/columns according to a partition of row indices
1 2 3 4 5 6 7 | merge_by_partition(
m,
partition,
agg = Matrix::colSums,
n_cpu = 1,
check = FALSE
)
|
m |
A matrix |
partition |
A list of integer vectors, which makes a full partition of the rows of |
agg |
Function. The function that will be called to merge the rows. Must return a matrix with the same number of columns and as many rows as needed. Default is |
n_cpu |
Integer. Number of cores to be used for the calculation, passed to the parameter |
check |
Logical. Should the function check if the provided partition is valid? Default is |
A new matrix with less (or more?) rows, depending on the aggregation function.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.