sweep_cols.matrix {statnet.common} | R Documentation |
Suptract a elements of a vector from respective columns of a matrix
Description
An optimized function equivalent to sweep(x, 2, STATS)
for a matrix
x
.
Usage
sweep_cols.matrix(x, STATS, disable_checks = FALSE)
Arguments
x |
a numeric matrix; |
STATS |
a numeric vector whose length equals to the number of columns
of |
disable_checks |
if |
Value
A matrix of the same attributes as x
.
Examples
x <- matrix(runif(1000), ncol=4)
s <- 1:4
stopifnot(all.equal(sweep_cols.matrix(x, s), sweep(x, 2, s)))
[Package statnet.common version 4.9.0 Index]