library (datasets) d <- dist (scale (mtcars)) a <- hclust(d, method="ward")
a <- hclust(d, method="single")
a <- hclust(d, method="complete")
a <- hclust(d, method="average")
a <- hclust(d, method="median")
a <- hclust(d, method="centroid")
a$merge a$dist.method a$method a$order a$height plot(a) grupos <- cutree (a, 5) rect.hclust (a, 5)
d <- dist (scale (t (mtcars)))
a <- hclust(d, method="ward")
plot (a)
install.packages ("pvclust")
library (pvclust)
a <- pvclust (scale (mtcars), method.hclust="ward", method.dist="euclidean")
plot (a) pvrect (a)
library (foreign)
cerveza <- read.spss ("Cerveza.sav", to.data.frame=TRUE)
rownames(cerveza) <- cerveza$CERVEZA cerveza$CERVEZA <- NULL plot (hclust (dist (cerveza)))
plot (hclust (dist (t (cerveza))))
plot (hclust (dist (t (scale (cerveza)))))
plot (hclust (dist (scale (cerveza))))
tailandia <- read.spss ("tailandia.sav", to.data.frame=TRUE)