The R Project SVN R

Rev

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

Rev 61160 Rev 61168
Line 204... Line 204...
204
(dend1 <- as.dendrogram(hc)) # "print()" method
204
(dend1 <- as.dendrogram(hc)) # "print()" method
205
str(dend1)          # "str()" method
205
str(dend1)          # "str()" method
206
str(dend1, max = 2, last.str =  "'") # only the first two sub-levels
206
str(dend1, max = 2, last.str =  "'") # only the first two sub-levels
207
oo <- options(str.dendrogram.last = "\\\\") # yet another possibility
207
oo <- options(str.dendrogram.last = "\\\\") # yet another possibility
208
str(dend1, max = 2) # only the first two sub-levels
208
str(dend1, max = 2) # only the first two sub-levels
209
options(oo)# .. resetting them
209
options(oo)  # .. resetting them
210
 
210
 
211
op <- par(mfrow =  c(2,2), mar = c(5,2,1,4))
211
op <- par(mfrow =  c(2,2), mar = c(5,2,1,4))
212
plot(dend1)
212
plot(dend1)
213
## "triangle" type and show inner nodes:
213
## "triangle" type and show inner nodes:
214
plot(dend1, nodePar = list(pch = c(1,NA), cex = 0.8, lab.cex = 0.8),
214
plot(dend1, nodePar = list(pch = c(1,NA), cex = 0.8, lab.cex = 0.8),
Line 226... Line 226...
226
## leaves are wrong horizontally:
226
## leaves are wrong horizontally:
227
plot(dend2$upper, nodePar = list(pch = c(1,7), col = 2:1))
227
plot(dend2$upper, nodePar = list(pch = c(1,7), col = 2:1))
228
##  dend2$lower is *NOT* a dendrogram, but a list of .. :
228
##  dend2$lower is *NOT* a dendrogram, but a list of .. :
229
plot(dend2$lower[[3]], nodePar = list(col = 4), horiz = TRUE, type = "tr")
229
plot(dend2$lower[[3]], nodePar = list(col = 4), horiz = TRUE, type = "tr")
230
## "inner" and "leaf" edges in different type & color :
230
## "inner" and "leaf" edges in different type & color :
231
plot(dend2$lower[[2]], nodePar = list(col = 1),# non empty list
231
plot(dend2$lower[[2]], nodePar = list(col = 1),   # non empty list
232
     edgePar = list(lty = 1:2, col = 2:1), edge.root = TRUE)
232
     edgePar = list(lty = 1:2, col = 2:1), edge.root = TRUE)
233
par(op)
233
par(op)
234
d3 <- dend2$lower[[2]][[2]][[1]]
234
d3 <- dend2$lower[[2]][[2]][[1]]
235
stopifnot(identical(d3, dend2$lower[[2]][[c(2,1)]]))
235
stopifnot(identical(d3, dend2$lower[[2]][[c(2,1)]]))
236
str(d3, last.str = "'")
236
str(d3, last.str = "'")