sum_rowcolCumsum: Sum of cumulative sum computed over rows then columns of...

Description Usage Arguments Value Examples

View source: R/query_drugs.R

Description

Equivalent to computing the cumulative sum of a matrix over rows, then over columns, then suming every value (though much faster and more memory efficient).

Usage

1

Arguments

x

Numeric vector of non-zero values of matrix.

i

Integer vector of row indices of x.

j

Integer vector of column indices of x.

Value

Numeric value equal to the sum of the cumulative sum computed over rows then columns of a matrix.

Examples

1
2
3
4
5
x <- c(1, 1, 1, -1) # non-zero values of matrix
i <- c(1, 2, 3, 4)  # row indices of x
j <- c(4, 1, 3, 2)  # col indices of x

sum_rowcolCumsum(x, i, j)

alexvpickering/ccmap documentation built on March 22, 2020, 6:08 p.m.