The R Project SVN R

Rev

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

Rev 61160 Rev 61168
Line 61... Line 61...
61
require(graphics)
61
require(graphics)
62
 
62
 
63
d1 <- dist(USArrests)
63
d1 <- dist(USArrests)
64
hc <- hclust(d1, "ave")
64
hc <- hclust(d1, "ave")
65
d2 <- cophenetic(hc)
65
d2 <- cophenetic(hc)
66
cor(d1,d2) # 0.7659
66
cor(d1, d2) # 0.7659
67
 
67
 
68
## Example from Sneath & Sokal, Fig. 5-29, p.279
68
## Example from Sneath & Sokal, Fig. 5-29, p.279
69
d0 <- c(1,3.8,4.4,5.1, 4,4.2,5, 2.6,5.3, 5.4)
69
d0 <- c(1,3.8,4.4,5.1, 4,4.2,5, 2.6,5.3, 5.4)
70
attributes(d0) <- list(Size = 5, diag = TRUE)
70
attributes(d0) <- list(Size = 5, diag = TRUE)
71
class(d0) <- "dist"
71
class(d0) <- "dist"