Learn R Programming

labeltodendro (version 1.3)

tabletodendro: converts a label matrix and a frequency vector to a labclust object

Description

The function assumes that labels appear in increasing order and also each row sorted in agglomerative order.

Usage

tabletodendro(labmat,freq,labels=NULL)

Arguments

labmat
A label matrix, each row sorted in agglomerative orde. Labels should appear in increasing order.
freq
A vector of frequencies corresponding to each row of labmat matrix.
labels
A vector of frequencies corresponding to each row of labmat matrix.

Details

If your label matrix does not have labels in increasing order use relabel.matrix. If the label matrix is not sorted in agglomerative order use selectlabels.

See Also

labclust, relabel.matrix, selectlabels

Examples

Run this code
labmat<-matrix(c(
c(1,1,1,1,1,1,1,1,1),
c(1,1,1,2,2,1,1,1,1), 
c(1,1,2,3,3,4,4,4,4)), ncol=9, byrow=TRUE) 
freq<-c(5,10,15)

plot(tabletodendro(labmat,freq,labels=paste("subject",1:9))) #plots the resulting dendrogram

plot(tabletodendro(labmat,freq),center=TRUE) # you may like to center the dendrogram
          

Run the code above in your browser using DataLab