Last data update: 2014.03.03

R: Plots for Hierarchical Classification on Principle Components...
plot.HCPCR Documentation

Plots for Hierarchical Classification on Principle Components (HCPC) results

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

## 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"

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

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)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(FactoMineR)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/FactoMineR/plot.HCPC.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plot.HCPC
> ### Title: Plots for Hierarchical Classification on Principle Components
> ###   (HCPC) results
> ### Aliases: plot.HCPC
> ### Keywords: dplot
> 
> ### ** Examples
> 
> data(iris)
> # Clustering, auto nb of clusters:
> res.hcpc=HCPC(iris[1:4], nb.clust=3)
dev.new(): using pdf(file="Rplots925.pdf")
dev.new(): using pdf(file="Rplots926.pdf")
dev.new(): using pdf(file="Rplots927.pdf")
> # 3D graph from a different point of view:
> plot(res.hcpc, choice="3D.map", angle=60)
> 
> 
> 
> 
> 
> dev.off()
png 
  2 
>