Learn R Programming

pbdDMAT (version 0.2-3)

scale: Scale

Description

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

Usage

## S3 method for class 'ddmatrix,ANY,ANY':
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.

Details

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

See Also

prcomp

Examples

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

Run the code above in your browser using DataLab