reductions {pbdDMAT} | R Documentation |
Arithmetic reductions for distributed matrices.
rowMin(x, ...) rowMax(x, ...) colMin(x, ...) colMax(x, ...) ## S4 method for signature 'ddmatrix' rowSums(x, na.rm = FALSE) ## S4 method for signature 'ddmatrix' colSums(x, na.rm = FALSE) ## S4 method for signature 'ddmatrix' rowMeans(x, na.rm = FALSE) ## S4 method for signature 'ddmatrix' colMeans(x, na.rm = FALSE) ## S4 method for signature 'ddmatrix' rowMin(x, na.rm = FALSE) ## S4 method for signature 'matrix' rowMin(x, na.rm = FALSE) ## S4 method for signature 'ddmatrix' colMin(x, na.rm = FALSE) ## S4 method for signature 'matrix' colMin(x, na.rm = FALSE) ## S4 method for signature 'ddmatrix' rowMax(x, na.rm = FALSE) ## S4 method for signature 'matrix' rowMax(x, na.rm = FALSE) ## S4 method for signature 'ddmatrix' colMax(x, na.rm = FALSE) ## S4 method for signature 'matrix' colMin(x, na.rm = FALSE)
x |
numeric distributed matrix |
... |
additional arguments |
na.rm |
logical. Should missing (including |
Performs the reduction operation on a distributed matrix.
There are several legitimately new operations, including rowMin()
,
rowMax()
, colMin()
, and colMax()
. These
implementations are not really necessary in R because one can easily (and
reasonably efficiently) do something like
apply(X=x, MARGIN=1L, FUN=min, na.rm=TRUE)
But apply()
on a ddmatrix
is very costly, and should be
used sparingly.
sd()
will compute the standard deviations of the columns, equivalent
to calling apply(x, MARGIN=2, FUN=sd)
(which will work for
distributed matrices, by the way). However, this should be much faster and
use less memory than apply()
. If reduce=FALSE
then the return
is a distributed matrix consisting of one (global) row; otherwise, an
R
vector is returned, with ownership of this vector determined by
proc.dest
.
Returns a global numeric vector.