plot.PCA {FactoMineR}R Documentation

Make the Principal Component Analysis (PCA) graphs

Description

Plot the graphs for a Principal Component Analysis (PCA) with supplementary individuals, supplementary quantitative variables and supplementary qualitative variables.

Usage

plot.PCA(x, axes = c(1, 2), choix = "ind",
    ellipse = NULL, xlim = NULL, ylim = NULL, habillage = "none", 
    col.hab = NULL, col.ind = "black", col.ind.sup = "blue", 
    col.quali = "magenta", col.quanti.sup = "blue", 
    col.var = "black", label = "all", invisible = NULL, 
    lim.cos2.var = 0., cex = 1, title = NULL, palette=NULL,
    new.plot = TRUE, ...)
    

Arguments

x an object of class PCA
axes a length 2 vector specifying the components to plot
choix the graph to plot ("ind" for the individuals, "var" for the variables)
ellipse boolean (NULL by default), if not null, draw ellipses around the individuals, and use the results of coord.ellipse
xlim range for the plotted 'x' values, defaulting to the range of the finite values of 'x'
ylim range for the plotted 'y' values, defaulting to the range of the finite values of 'y'
habillage give no color for the individuals ("none"), a color for each individual ("ind"), or color the individuals among a qualitative variable (give the number of the qualitative variable)
col.hab a vector with the color to use for the individuals
col.ind a color for the individuals if there only is not habillage
col.ind.sup a color for the supplementary individuals only if there is not habillage
col.quali a color for the categories of qualitative variable sonly if there is not habillage
col.quanti.sup a color for the quantitative supplementary variables
col.var a color for the variables
label a list of character for the elements which are labelled (by default, all the elements are labelled ("ind", ind.sup", "quali", "var", "quanti.sup"))
invisible string indicating if some points should not be drawn ("ind", "ind.sup" or "quali" for the individual graph and "var" or "quanti.sup" for the correlation circle graph)
lim.cos2.var value of the square cosinus under the variables are not drawn
cex cf. function par in the graphics package
title string corresponding to the title of the graph you draw (by default NULL and a title is chosen)
palette the color palette used to draw the points. By default colors are chosen. If you want to define the colors : palette=palette(c("black","red","blue")); or you can use: palette=palette(rainbow(30)), or in black and white for example: palette=palette(gray(seq(0,.9,len=25)))
new.plot boolean, if TRUE, a new graphical device is created
... further arguments passed to or from other methods

Value

Returns the individuals factor map and the variables factor map.

Author(s)

Jeremy Mazet, Francois Husson Francois.Husson@agrocampus-ouest.fr

See Also

PCA

Examples

data(decathlon)
res.pca <- PCA(decathlon, quanti.sup = 11:12, quali.sup = 13)
plot(res.pca, habillage = 13, col.hab=c("green","blue"))
## To draw ellipses around the barycentres
aa=cbind.data.frame(decathlon[,13],res.pca$ind$coord)
bb=coord.ellipse(aa,bary=TRUE)
plot.PCA(res.pca,habillage=13,ellipse=bb)

[Package FactoMineR version 1.10 Index]