Compute matrix statistics selecting the appropriate function depending on the matrix class of the input (supports sparse matrices and DelayedArrays)

safeMatrixStats(X, statFun = "rowSums", ...)

Arguments

X

input matrix

statFun

statistic. E.g. "rowSums", "colSums", "rowMeans", "colMeans", ...

...

arguments passed on to the matrix stats function. E.g. na.rm.

Value

result of the corresponding matrix statistic

Author

Fabian Mueller