pca {SensoMineR}R Documentation

Principal components analysis

Description

Performs a PCA and returns the individuals factor map and the variables factor map.

Usage

pca(df, supind = NULL, supvar = NULL,
   row.w = rep(1,nrow(df)-length(supind))/(nrow(df)-length(supind)),
   scale.unit = TRUE, coord = c(1,2), graph = TRUE, 
   main.title = NULL, clabel = 1, cex = 0.7, font = 1, csub = 1, 
   col = "black", lty = 1)

Arguments

df a data frame with n rows (individuals) and p columns (numeric variables)
supind indexes of the illustrative individuals
supvar indexes of the illustrative variables
row.w an optional row weights (by default, uniform row weights)
scale.unit a boolean, if TRUE (value set by default) then data are scaled to unit variance
coord a length 2 vector specifying the components to plot
graph boolean, if TRUE a graph is displayed
main.title the title of the graph
clabel if not NULL, a character size for the labels, used with par("cex")*clabel
cex cf. function par in the graphics package
font cf. function par in the graphics package
csub a character size for the legend, used with par("cex")*csub
col color of the variables
lty line type of the arrows

Value

Returns a list including:

eig a numeric vector with the all eigenvalues
li a matrix with the coordinates of rows
co a matrix with the coordinates of columns
lisup a matrix with the coordinates of illustrative rows
cosup a matrix with the coordinates of illustrative columns


Returns the individuals factor map and the variables factor map.

Author(s)

François Husson, Sébastien Lê

Examples

data(chocolates)
resaverage<-averagetable(chocolates, formul = "~Product+Panelist", 
    firstvar = 5)
pca(resaverage, scale.unit = TRUE)

[Package SensoMineR version 1.03 Index]