Learn R Programming

MultiGroupO (version 0.4.0)

pca: Performs a principal components analysis in the given data matrix. Show PCA graphical output.

Description

Performs a principal components analysis in the given data matrix. Show PCA graphical output.

Usage

pca(datos, grupos, Plot = TRUE, center = TRUE, scale = TRUE)

Value

return an grafics.

Arguments

datos

is a matrix with the data

grupos

is a vector of classes

Plot

vector logic for grafic

center

data set center by columns

scale

data set scaled by columns

Examples

Run this code
library(plsgenomics)
data(SRBCT)
mydata<-SRBCT$X
mydata<-mydata[1:30,1:20]
groups<-as.factor(SRBCT$Y)[1:30]
pca(datos=mydata,grupos=groups,Plot=TRUE,center=TRUE,scale=TRUE)

Run the code above in your browser using DataLab