require(graphics)
hc <- hclust(dist(USArrests), "ave")
plot(hc)
plot(hc, hang = -1)
你是要做聚类分析是吧,应该是用这个函数是吧hclust(d, method = "complete", members = NULL)。你在r里面输入?hclust。d代表不同结构的分布,你可以运行一下这个程序看一下require(graphics)
hc <- hclust(dist(USArrests), "ave")
plot(hc)
plot(hc, hang = -1)