Learn R Programming

PCA4you (version 1.2.4)

PCA.Plotter: PCA.Plotter

Description

Makes the basic PCA plots on a given matrix. Scores and loadings scatterplots of PC1 vs PC2. Centers and UV-scales the variables, makes a 2 component PCA. Supports NAs but requires variance in all variables. Presents R2 for each component. Uses the package "mixOmics". Rownames/colnames are used as point labels.

Usage

PCA.Plotter(data.mat)

Arguments

data.mat

a numeric matrix or data frame. Long, wide and squared matrix supported. NAs supported. Variance required for all variables.

Examples

Run this code
# NOT RUN {
set.seed(5)
num.of.variables <- 14
num.of.observations <- 34
rn <- rnorm(num.of.variables * num.of.observations)
data.mat <- matrix(rn, nrow = num.of.observations, ncol = num.of.variables)
PCA.Plotter(data.mat)
# }

Run the code above in your browser using DataLab