Learn R Programming

scanstatistics (version 1.0.1)

sum_reorder_sum: Cumulatively sum, order by priority, then sum again.

Description

For a given matrix, form a new matrix by cumulatively summing over its columns. Reorder the row contents in this matrix by the corresponding indices in the given priority matrix. Then cumulatively sum over each row, yielding a new matrix of the same size as the input matrix.

Usage

sum_reorder_sum(A, priority_indices)

Arguments

A

A numeric or integer matrix.

priority_indices

An integer matrix as output by prioritize_cols.