4
我希望从hclust对象创建一个“子树”。有没有办法从hclust中获得“子树”? (R)
例如,假设我有以下对象:
a <- list() # initialize empty object
a$merge <- matrix(c(-1, -2,
-3, -4,
1, 2,
-5,-6,
3,4), nc=2, byrow=TRUE)
a$height <- c(1, 1.5, 3,4,4.5) # define merge heights
a$order <- 1:6 # order of leaves(trivial if hand-entered)
a$labels <- 1:6# LETTERS[1:4] # labels of leaves
class(a) <- "hclust" # make it an hclust object
plot(a) # look at the result
现在,我想从它的提取物下面的子树:
a <- list() # initialize empty object
a$merge <- matrix(c(-1, -2,
-3, -4,
1, 2
), nc=2, byrow=TRUE)
a$height <- c(1, 1.5, 3) # define merge heights
a$order <- 1:4 # order of leaves(trivial if hand-entered)
a$labels <- 1:4# LETTERS[1:4] # labels of leaves
class(a) <- "hclust" # make it an hclust object
plot(a) # look at the result
我怎么能访问它?
(我知道cutree可以让我的子树的对象,而不是创建一个实际hclust对象)的任何帮助
感谢,
塔尔
正是我在找的东西。谢谢尼科。 – 2010-06-14 10:53:28