Learn R Programming

pbdDMAT (version 0.4-2)

ddmatrix-scale: Scale

Description

Centers and/or scales the columns of a distributed matrix.

Usage

scale(x, center = TRUE, scale = TRUE)

# S4 method for ddmatrix scale(x, center = TRUE, scale = TRUE)

Arguments

x

numeric distributed matrix.

center

logical value, determines whether or not columns are zero centered

scale

logical value, determines whether or not columns are rescaled to unit variance

Value

Returns a distributed matrix.

Examples

Run this code
# 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()

comm.set.seed(diff=T)

x <- ddmatrix("rnorm", 10, 10)
y <- scale(x)

print(y)

finalize()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab