plot.HCPC: Plots for Hierarchical Classification on Principle Components...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/plot.HCPC.R

Description

Plots graphs from a HCPC result: tree, barplot of inertia gains and first factor map with or without the tree, in 2 or 3 dimensions.

Usage

1
2
3
4
5
## S3 method for class 'HCPC'
plot(x, axes=c(1,2), choice="3D.map", rect=TRUE, 
  draw.tree=TRUE, ind.names=TRUE, t.level="all", title=NULL,
  new.plot=FALSE, max.plot=15, tree.barplot=TRUE,
  centers.plot=FALSE, ...)

Arguments

x

A HCPC object, see HCPC for details.

axes

a two integers vector.Defines the axes of the factor map to plot.

choice

A string. "tree" plots the tree. "bar" plots bars of inertia gains. "map" plots a factor map, individuals colored by cluster. "3D.map" plots the same factor map, individuals colored by cluster, the tree above.

rect

a boolean. If TRUE, rectangles are drawn around clusters if choice ="tree".

tree.barplot

a boolean. If TRUE, the barplot of intra inertia losses is added on the tree graph.

draw.tree

A boolean. If TRUE, the tree is projected on the factor map if choice ="map".

ind.names

A boolean. If TRUE, the individuals names are added on the factor map when choice="3D.map" or choice="map"

t.level

Either a positive integer or a string. A positive integer indicates the starting level to plot the tree on the map when draw.tree=TRUE. If "all", the whole tree is ploted. If "centers", it draws the tree starting t the centers of the clusters.

title

a string. Title of the graph. NULL by default and a title is automatically defined

centers.plot

a boolean. If TRUE, the centers of clusters are drawn on the 3D factor maps.

new.plot

a boolean. If TRUE, the plot is done in a new window.

max.plot

The max for the bar plot

...

Other arguments from other methods.

Value

Returns the chosen plot.

Author(s)

Guillaume Le Ray, Quentin Molto, Francois Husson husson@agrocampus-ouest.fr

See Also

HCPC

Examples

1
2
3
4
5
data(iris)
# Clustering, auto nb of clusters:
res.hcpc=HCPC(iris[1:4], nb.clust=3)
# 3D graph from a different point of view:
plot(res.hcpc, choice="3D.map", angle=60)

Example output

dev.new(): using pdf(file="Rplots1.pdf")
dev.new(): using pdf(file="Rplots2.pdf")

FactoMineR documentation built on Jan. 8, 2021, 2:18 a.m.