pca: Principal components analysis (PCA) calculated using singular...

Description Usage Arguments

View source: R/pca.R

Description

Principal components analysis (PCA) calculated using singular value decomposition (SVD).

Usage

1
pca(data, center_data = TRUE, scale_data = TRUE, max_pcs = NULL)

Arguments

data

A matrix or data.frame of your data. Rows will be points, columns will be vectors.

center_data

This is an important step for PCA! Just leave it as TRUE unless you really know what you're doing.

scale_data

You might want to scale your data if the magnitude of your predictor variables is highly variable, otherwise variables whose magnitude is much larger than the rest of the variables will likely dominate other variables. On the other hand, this might be what you want. It's up to you! (Note that you can not use scale if one of your variables is constant or zero.)

max_pcs

If you have a large matrix that is taking a lot of time, but you only need to keep a couple of PCs, you could set max_pcs to something like 2 (e.g., if you only need to make a biplot) in order to speed up the computation.


mooreryan/biplotr documentation built on Sept. 2, 2020, 8:32 a.m.