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)

Example output

Warning message:
In read.dcf(con) :
  URL 'http://bioconductor.org/BiocInstaller.dcf': status was 'Couldn't resolve host name'
[1] 17

ccmap documentation built on Nov. 8, 2020, 5:14 p.m.