colorplot: colored dendrogram plot of a labclust object

Description Usage Arguments Details See Also Examples

View source: R/labeltodendro.R

Description

The dendrogram is cut at the appropriate value, defined in a labclust object, and leaves are coloured repectively.

Usage

1
2
 colorplot(x,h,horiz=FALSE,...)
	

Arguments

x

A labclust object to be plotted.

h

The height that the tree should be cut, automatically extracted from a labclust object.

horiz

Clarifies to plot the dendrogram horizontally or vertically.

...

Some of dendrogram plot options, but not all.

Details

The colorplot function is a modified version of HeatPlus package to cut a dendrogram and colour its leaves. Leaves with single element won't be coloured.

See Also

plot.labclust

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
x<-matrix(c(
c(1,1,1,1,1,1,1,1,1),
c(2,2,2,2,1,2,2,2,2), #exchangeable labels are allowed like this
c(1,1,1,1,1,2,2,2,2),
c(2,2,1,2,2,3,3,3,3),
c(1,1,2,1,1,3,3,3,3),#or like this 
c(1,1,2,1,1,3,3,3,3),
c(1,1,2,3,4,5,5,5,5),
c(1,1,2,3,4,5,5,5,5),
c(1,2,3,4,5,6,7,8,9)), ncol=9, byrow=TRUE) #each iteration in a row

y<-labeltodendro(x)
mydendro<-as.dendrogram(y)
colorplot(y,horiz=TRUE,lwd=3,cluscol=c("red","green","blue")) #leaves with single subjects won't get your specified color
plot(labeltodendro(x),horiz=TRUE) # changes orientation and dendrogram height starts from zero
          

labeltodendro documentation built on May 29, 2017, 6:07 p.m.