Description Usage Arguments Details Value See Also Examples
View source: R/labeltodendro.R
The function is useful to make a summary table of Markov chain Monte Carlo labels for dendrogram representation. Exchangeable labels are allowed.
1 | 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 |
tabletodendro, labeltodendro, selectlabels
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.