Description Usage Arguments Details Value See Also Examples
View source: R/labeltodendro.R
The labels which are not agglomerations or divisions of the most frequent label, will be removed. The function does not allow exchangeable labels.
1 2 | selectlabels(labmat,freq)
|
labmat |
A matrix of labels, each row corresponding to a labelling. |
freq |
A vector of frequencies, each element corresponding to frequency of a |
The function is useful if you have already counted your labels but you are not sure that they are in agglomerative order.
The functions assumes your labels appear in increasing order, if your lables are like that, you should use relabel.matrix
before.
labmat |
Series of labels, sorted in agglomerative order. |
freq |
A vector of frequencies corresponding to the sorted labels. |
relabel.matrix
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | labmat<-matrix(c(
c(1,1,1,1,1,1,1,1,1),
c(2,2,2,2,1,2,2,2,2), #labels do not appear in increasing order
c(2,2,1,2,2,3,3,3,3), # here too, this is the most freqent label according to freq
c(1,1,2,2,2,2,2,3,3), # this is not agglomeration nor division of the most frequent label
c(1,2,3,4,5,6,7,8,9)), ncol=9, byrow=TRUE)
freq<-c(1,2,3,2,1)
labmat<-relabel.matrix(labmat)
labmat
# now labels of labmat appear in increasing order
y<-selectlabels(labmat,freq)
y$labmat
#now y is in agglomerative order
y$freq
# frequencies corresponding to ordered labels
plot(tabletodendro(y$labmat,y$freq))
# see the resulting dendrogram
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.