]> git.donarmstrong.com Git - ape.git/blobdiff - R/as.phylo.R
a few changes....
[ape.git] / R / as.phylo.R
index 79491d20c3c1dc36716682a8760e0e0c1dc49dd0..b576a54e0b719992d2cf653ace068e15926566dc 100644 (file)
@@ -1,4 +1,4 @@
-## as.phylo.R (2010-04-06)
+## as.phylo.R (2010-09-30)
 
 ##     Conversion Among Tree Objects
 
@@ -91,7 +91,7 @@ as.hclust.phylo <- function(x, ...)
     n <- length(x$tip.label)
     bt <- rev(branching.times(x))
     N <- length(bt)
-    nm <- as.numeric(names(bt))
+    nm <- x$Nnode:1 + n # fix by Filipe G. Vieira (2010-09-30)
     merge <- matrix(NA, N, 2)
     for (i in 1:N) {
         ind <- which(x$edge[, 1] == nm[i])