Created
June 22, 2024 08:58
-
-
Save abikoushi/58a1e0772969a26a74ff2b640ae418e2 to your computer and use it in GitHub Desktop.
What is the difference between `ward.D` and `ward.D2`?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
X <- as.matrix(iris[,-5]) | |
d <- dist(X) | |
h1 <- hclust(d^2, method = "ward.D") | |
h2 <- hclust(d, method = "ward.D2") | |
h1$height <- sqrt(h1$height) | |
#png("dendro2.png") | |
par(mfrow=c(1,2)) | |
plot(h1) | |
plot(h2) | |
#dev.off() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment