Learn R Programming

fChange (version 2.1.0)

pca: Generic Function for Principal Component Analysis

Description

This is a generic function to call PCA on various objects. The default method uses stats::prcomp().

Usage

pca(object, TVE = 1, ...)

# S3 method for default pca(object, ...)

# S3 method for dfts pca(object, TVE = 1, ...)

Value

Principal component data. Note that the scores are in x and the eigenfuctions in rotation. This is to keep consistency between existing pca methods in R, but may change in the future.

Arguments

object

Object for computation of principle components analysis.

TVE

Numeric in [0,1] for the total variance explained, this determines the number of components and can be used for dimension reduction.

...

Additional parameters to extensions based on data. Often this is additional information for prcomp.

Examples

Run this code
pca(1:10)
pca(electricity)

Run the code above in your browser using DataLab