Learn R Programming

pbdDMAT (version 0.2-3)

PCA: Principal Components Analysis

Description

Performs the principal components analysis.

Usage

## S3 method for class 'ddmatrix':
prcomp(x, retx = TRUE, center = TRUE, 
  scale. = FALSE, tol = NULL)

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
retx
logical, indicates whether the rotated variables should be returned
tol
a value indicating the magnitude below which components should be omitted. (Components are omitted if their standard deviations are less than or equal to tol times the standard deviation of the first component.) With the default null

Value

  • Returns a list.

Details

prcomp() performs the principal components analysis on the data matrix by taking the SVD. Sometimes core R and pbdDMAT will disagree slightly in what the rotated variables are because of how the SVD is caluclated. See the details section of La.svd() under LinAlg for details. more details.

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 <- prcomp(x)
comm.print(y)

finalize()

Run the code above in your browser using DataLab