]> git.donarmstrong.com Git - ape.git/blobdiff - R/dist.topo.R
new image.DNAbin()
[ape.git] / R / dist.topo.R
index 86b396b9aa9814abade98b2c5bd86c3f75fe25ee..d94866adfe1c65f9c46946567573196b6a4e51a9 100644 (file)
@@ -1,9 +1,9 @@
-## dist.topo.R (2010-05-25)
+## dist.topo.R (2011-02-21)
 
 ##      Topological Distances, Tree Bipartitions,
 ##   Consensus Trees, and Bootstrapping Phylogenies
 
-## Copyright 2005-2010 Emmanuel Paradis
+## Copyright 2005-2011 Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -100,17 +100,16 @@ prop.part <- function(..., check.labels = TRUE)
     if (length(obj) == 1 && class(obj[[1]]) != "phylo")
         obj <- obj[[1]]
     ## <FIXME>
-    ## class(obj) <- NULL # needed?
+    ## class(obj) <- NULL # needed? apparently not, see below (2010-11-18)
     ## </FIXME>
     ntree <- length(obj)
     if (ntree == 1) check.labels <- FALSE
-    if (check.labels) obj <- .compressTipLabel(obj)
+    if (check.labels) obj <- .compressTipLabel(obj) # fix by Klaus Schliep (2011-02-21)
     for (i in 1:ntree) storage.mode(obj[[i]]$Nnode) <- "integer"
     ## <FIXME>
     ## The 1st must have tip labels
     ## Maybe simply pass the number of tips to the C code??
-    if (!is.null(attr(obj, "TipLabel")))
-        for (i in 1:ntree) obj[[i]]$tip.label <- attr(obj, "TipLabel")
+    obj <- .uncompressTipLabel(obj) # fix a bug (2010-11-18)
     ## </FIXME>
     clades <- .Call("prop_part", obj, ntree, TRUE, PACKAGE = "ape")
     attr(clades, "number") <- attr(clades, "number")[1:length(clades)]