Learn R Programming

kazaam (version 0.1-0)

prcomp: Principal Components Analysis

Description

Performs the principal components analysis.

Usage

# S3 method for shaq
prcomp(x, retx = TRUE, center = TRUE, scale. = FALSE,
  tol = NULL, ...)

Arguments

x

A shaq.

retx

Should the rotated variables be returned?

center

Should columns are zero centered?

scale.

Should columns are rescaled to unit variance?

tol

Ignored.

...

Ignored.

Value

A list of elements sdev, rotation, center, scale, and x, as with R's own prcomp(). The elements are, respectively, a regular vector, a regular matrix, a regular vector, a regular vector, and a shaq.

Communication

The communication is an allreduce() call, quadratic on the number of columns. Most of the run time should be dominated by relatively expensive local operations.

Details

prcomp() performs the principal components analysis on the data matrix by taking the SVD. Sometimes core R and kazaam will disagree slightly in what the rotated variables are because of how the SVD is caluclated.

Examples

Run this code

library(kazaam)
x = ranshaq(runif, 10, 3)
pca = prcomp(x)

comm.print(pca)

finalize()


Run the code above in your browser using DataLab