Created
April 2, 2019 10:14
-
-
Save nashutoing/6327dfb724ad8f52994f68d6574cee70 to your computer and use it in GitHub Desktop.
dendrogram for Central league and Pacific league
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
NPB18cebaZ<- scale(NPB18ceba[4:25]) #standardization | |
distZ<- data.frame(NPB18cebaZ) #? | |
distZ<- dist(NPB18cebaZ) #dcalculate distance,default method =euclidean | |
hclust(distZ) #clustering | |
summary(hclust(distZ)) | |
plot(hclust(distZ)) #dendrogram | |
a<- hclust(distZ,method = "average") | |
hclust(distZ)$merge | |
par(mfrow=c(1,2)) #to compare | |
plot(hclust(distZ),main = "default complete:最遠隣法") | |
plot(a,main = "average:群平均法") | |
b<- hclust(distZ,method="centroid") | |
plot(b,main = "centroid:重心法") | |
c<- hclust(distZ,method="ward") | |
plot(c,main= "ward.D:ウォード法") | |
d<- hclust(distZ,method="ward.D2") | |
plot(d,main="ward.D2") | |
NPB18pabaZ<- scale(NPB18paba[4:25]) | |
distpabaZ<- dist(NPB18pabaZ) | |
hclust(distpabaZ) | |
plot(hclust(distpabaZ)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment