[Phylobase-commits] r440 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jun 20 03:08:36 CEST 2009


Author: regetz
Date: 2009-06-20 03:08:36 +0200 (Sat, 20 Jun 2009)
New Revision: 440

Modified:
   pkg/R/treestruc.R
Log:
fixed hasPoly to tabulate ancestor nodes (bug #462)


Modified: pkg/R/treestruc.R
===================================================================
--- pkg/R/treestruc.R	2009-06-20 01:00:48 UTC (rev 439)
+++ pkg/R/treestruc.R	2009-06-20 01:08:36 UTC (rev 440)
@@ -5,7 +5,7 @@
 ##   any(edgeLength(x)==0) if necessary
 hasPoly <- function(object) {
   if(!checkPhylo4(object)) stop("to be used with a phylo4 object")
-  degree <- tabulate(edges(object)[, 2])
+  degree <- tabulate(na.omit(edges(object)[, 1]))
   struc <- any(degree > 2)
   return(struc)
 }



More information about the Phylobase-commits mailing list