Closed GillesSanMartin closed 5 years ago
Hi @GillesSanMartin , I've just pushed a new version of dendextend.
Before the fix:
> library(cluster)
> a <- diana(votes.repub, metric = "manhattan", stand = TRUE)
> dendextend::cutree(a, k=3)
Show Traceback
Rerun with Debug
Error in cutree.default(a, k=3) :
Function cutree is only available for hclust/dendrogram/phylo objects only.
After the fix:
library(cluster)
a <- diana(votes.repub, metric = "manhattan", stand = TRUE)
dendextend::cutree(a, k= 3)
> dendextend::cutree(a, k= 3)
Alabama Alaska Arizona Arkansas California Colorado Connecticut
1 2 3 1 3 3 3
Delaware Florida Georgia
etc...
Please confirm that it works for you as well?
Waouh that was quick ! It works indeed with the new dendextend 1.10.0 I will modify the SO answer to point to this better solution...
Thanks for the quick response and for developing such an excellent package !
My pleasure, thanks for the bug report :)
Loading
dendextend
causescutree
to return an error when applied oncluster
obsjects (agnes
,diana
). This breaks some other packages likeclValid
.See for example this SO question (with reproducible example) : https://stackoverflow.com/questions/52319709
Would it be possible to do something from dendextend to avoid that ?