| rounding {pbdDMAT} | R Documentation |
Extensions of R rounding functions for distributed matrices.
## S4 method for signature 'ddmatrix' round(x, digits = 0) ## S4 method for signature 'ddmatrix' ceiling(x) ## S4 method for signature 'ddmatrix' floor(x)
x |
numeric distributed matrix |
digits |
integer indicating the number of decimal places
( |
Rounding to a negative number of digits means rounding to a power of ten, so
for example round(x, digits = -2) rounds to the nearest hundred.
Returns a distributed matrix.
## Not run: # Save code in a file "demo.r" and run with 2 processors by # > mpiexec -np 2 Rscript demo.r library(pbdDMAT, quiet = TRUE) init.grid() # don't do this in production code x <- matrix(1:9, 3) x <- as.ddmatrix(x) y <- ceiling(x/3) print(y) finalize() ## End(Not run)