Learn R Programming

FactoMineR (version 1.01)

plot.PCA: 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.1,
    cex = 1, title = NULL, ...)

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
allows to colored the individuals among a 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", "quanti"
invisible
string indicating if some points should not be drawn ("ind" or "quali")
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)
...
further arguments passed to or from other methods

Value

  • Returns the individuals factor map and the variables factor map.

See Also

PCA

Examples

Run this code
data(decathlon)
res.pca <- PCA(decathlon, quanti.sup = 11:12, quali.sup = 13)
plot(res.pca, habillage = "quali", col.hab=c("green","blue"))

Run the code above in your browser using DataLab