rowCenter_cpp {riskRegression} | R Documentation |
Apply - by row
Description
Fast computation of sweep(X, MARGIN = 2, FUN = "-", STATS = center)
Usage
rowCenter_cpp(X, center)
Arguments
X |
A matrix. |
center |
a numeric vector of length equal to the number of rows of |
Value
A matrix of same size as X.
Author(s)
Brice Ozenne <broz@sund.ku.dk>
Examples
x <- matrix(1,6,5)
sweep(x, MARGIN = 2, FUN = "-", STATS = 1:5)
rowCenter_cpp(x, 1:5 )
rowCenter_cpp(x, colMeans(x) )
[Package riskRegression version 2023.12.21 Index]