The R Project SVN R

Rev

Rev 59039 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 59039 Rev 61160
Line 43... Line 43...
43
  \code{\link{hclust}}, \code{\link{dendrogram}} for cutting trees themselves.
43
  \code{\link{hclust}}, \code{\link{dendrogram}} for cutting trees themselves.
44
}
44
}
45
\examples{
45
\examples{
46
hc <- hclust(dist(USArrests))
46
hc <- hclust(dist(USArrests))
47
 
47
 
48
cutree(hc, k=1:5) #k = 1 is trivial
48
cutree(hc, k = 1:5) #k = 1 is trivial
49
cutree(hc, h=250)
49
cutree(hc, h = 250)
50
 
50
 
51
## Compare the 2 and 4 grouping:
51
## Compare the 2 and 4 grouping:
52
g24 <- cutree(hc, k = c(2,4))
52
g24 <- cutree(hc, k = c(2,4))
53
table(grp2=g24[,"2"], grp4=g24[,"4"])
53
table(grp2 = g24[,"2"], grp4 = g24[,"4"])
54
}
54
}
55
\keyword{multivariate}
55
\keyword{multivariate}
56
\keyword{cluster}
56
\keyword{cluster}