]> git.donarmstrong.com Git - ape.git/blobdiff - R/dist.topo.R
new compute.brtime() + minor change in dist.topo.R
[ape.git] / R / dist.topo.R
index 455107ec924c43eab1527bbc52503b3fb3e72643..525178f2528ed1ba66321e178d8c79d2cf0c91ed 100644 (file)
@@ -1,4 +1,4 @@
-## dist.topo.R (2011-06-14)
+## dist.topo.R (2011-07-13)
 
 ##      Topological Distances, Tree Bipartitions,
 ##   Consensus Trees, and Bootstrapping Phylogenies
@@ -268,6 +268,7 @@ consensus <- function(..., p = 1, check.labels = TRUE)
     ## Get all observed partitions and their frequencies:
     pp <- prop.part(obj, check.labels = FALSE)
     ## Drop the partitions whose frequency is less than 'p':
+    if (p == 0.5) p <- 0.5000001 # avoid incompatible splits
     pp <- pp[attr(pp, "number") >= p * ntree]
     ## Get the order of the remaining partitions by decreasing size:
     ind <- sort(unlist(lapply(pp, length)), decreasing = TRUE,