fixNonMonotHca | R Documentation |
Solving non-monotonous heights in HCA clustering.
fixNonMonotHca(hca, method = c("eps", "halfway"), eps = NULL)
hca |
an object of class |
method |
replacement method, one of 'eps', and
'halfway'.
The 'eps' method makes the non-monotonous heights to be monotonous
by shifting them just above the last monotonous height ( |
eps |
parameter of the 'eps' method, if |
fixNonMonotHca
replaces non-monotonous heights in a
dendrogram representing a hierarchical clustering with artificial
values making the heights monotonous.
However, please note that non-monotonous heights appear naturally in
dendrograms resulting from some HCA methods including
link{mhclust}
, such that altering the heights result in
artificial dendrograms that do NOT represent the structure of the
clustered data. Please consider using HCA methods producing
monotonous before attempting to remove the non-monotonous heights,
e.g. for the purpose of graphical presentation of the dendrogram.
An object of class link[stats]{hclust}
having the
height
component fixed.
Tomas Sieger, Karel Fiser
# simple example
d<-cbind(1:3,1:3)
hd<-mhclust(d)
# original dendrogram
print(hd$height)
hdFixed<-fixNonMonotHca(hd)
# dendrogram with resolved non-monotonous heights
print(hdFixed$height)
# another example
set.seed(1)
x<-cbind(runif(20),runif(20))
hx<-hclust(dist(x)^2,'cen')
hx1<-fixNonMonotHca(hx,method='eps')
hx2<-fixNonMonotHca(hx,method='halfway')
opar<-par(mfrow=c(1,3))
plot(hx,main='Original')
plot(hx1,main='Fixed by the "eps" method')
plot(hx2,main='Fixed by the "halfway" method')
par(opar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.