[Phylobase-commits] r544 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Aug 20 23:45:26 CEST 2009


Author: bbolker
Date: 2009-08-20 23:45:23 +0200 (Thu, 20 Aug 2009)
New Revision: 544

Modified:
   pkg/R/methods-phylo4.R
Log:
updated/fixed code to remove root edge NAs from branch length summary



Modified: pkg/R/methods-phylo4.R
===================================================================
--- pkg/R/methods-phylo4.R	2009-08-20 21:19:51 UTC (rev 543)
+++ pkg/R/methods-phylo4.R	2009-08-20 21:45:23 UTC (rev 544)
@@ -385,10 +385,10 @@
     if(!is.null(x at edge.length)){
         res$mean.el <- mean(x at edge.length, na.rm=TRUE)
         res$var.el <- var(x at edge.length, na.rm=TRUE)
-        if (isRooted(x)) {
-            res$sumry.el <- summary(x at edge.length[-rootNode(x)])[-4]
+        if (isRooted(x) && is.na(x at edge.length[rootNode(x)])) {
+            res$sumry.el <- summary(x at edge.length[-rootNode(x)])
         } else {
-            res$sumry.el <- summary(x at edge.length)[-4]
+            res$sumry.el <- summary(x at edge.length)
         }
     } else {
         res$mean.el <- NULL



More information about the Phylobase-commits mailing list