[Phylobase-commits] r599 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Aug 27 03:59:03 CEST 2009


Author: francois
Date: 2009-08-27 03:59:02 +0200 (Thu, 27 Aug 2009)
New Revision: 599

Modified:
   pkg/R/methods-phylo4.R
   pkg/R/methods-phylo4d.R
Log:
teaked summary method for phylo4d to match behavior of summary with phylo4

Modified: pkg/R/methods-phylo4.R
===================================================================
--- pkg/R/methods-phylo4.R	2009-08-27 01:43:02 UTC (rev 598)
+++ pkg/R/methods-phylo4.R	2009-08-27 01:59:02 UTC (rev 599)
@@ -455,6 +455,7 @@
         }
     }
     return(invisible(res))
+
 }) # end setMethod summary phylo4
 
 

Modified: pkg/R/methods-phylo4d.R
===================================================================
--- pkg/R/methods-phylo4d.R	2009-08-27 01:43:02 UTC (rev 598)
+++ pkg/R/methods-phylo4d.R	2009-08-27 01:59:02 UTC (rev 599)
@@ -191,14 +191,17 @@
 ## Marguerite Butler & Peter Cowan
 setMethod("summary", "phylo4d", function(object) {
     x <- object
-    summary(as(x, "phylo4"))
+    res <- summary(as(x, "phylo4"))
+    res$name <- deparse(substitute(object, sys.frame(-1)))
     tips <- tdata(object, "tip")
     nodes <- tdata(object, "internal")
     cat("\nComparative data:\n")
     if (nrow(tips) > 0) {
         cat("\nTips: data.frame with", nTips(object), "taxa and",
             ncol(tips), "variable(s) \n\n")
-        print(summary(tips))
+        sumry.tips <- summary(tips)
+        res$sumry.tips <- sumry.tips
+        print(sumry.tips)
     }
     else {
         cat("\nObject contains no tip data.")
@@ -206,11 +209,14 @@
     if (nrow(nodes) > 0) {
         cat("\nNodes: data.frame with", nNodes(object), "internal nodes and",
             ncol(nodes), "variables \n\n")
-        print(summary(nodes))
+        sumry.nodes <- summary(nodes)
+        res$sumry.nodes <- sumry.nodes
+        print(sumry.nodes)
     }
     else {
         cat("\nObject contains no node data.\n")
     }
+    invisible(res)
 })
 
 setMethod("hasNodeData", "phylo4d", function(x) {



More information about the Phylobase-commits mailing list