labeltotable {labeltodendro} | R Documentation |
The function is useful to make a summary table of Markov chain Monte Carlo labels for dendrogram representation. Exchangeable labels are allowed.
labeltotable(x)
x |
a numeric matrix of integers with iterations in rows and labels in columns; each row of x corresponds to a grouping |
The function may not be computationally efficient for large number of iterations or large number of clustered subjects. This function counts labels and then orders the resulting table based on agglomeration and divisions of the most frequent label.
labmat |
A matrix of labels ordered in agglomerative order. |
freq |
The vector of frequencies corresponding to each row of labmat . |
tabletodendro, labeltodendro, selectlabels
x<-matrix(c( c(1,1,1,1,1,1,1,1,1), c(2,2,2,2,2,1,1,1,1), #exchangeable labels are allowed 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), 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 # this creates a matrix of labels labtotab<-labeltotable(x) # counts labels and summarises x labtotab$lab #gives labels labtotab$freq #gives the corresponding freqencies to the labels