[Phylobase-commits] r637 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Sep 11 19:41:10 CEST 2009


Author: francois
Date: 2009-09-11 19:41:10 +0200 (Fri, 11 Sep 2009)
New Revision: 637

Modified:
   pkg/R/methods-phylo4d.R
Log:
added signature to phylo4d methods

Modified: pkg/R/methods-phylo4d.R
===================================================================
--- pkg/R/methods-phylo4d.R	2009-09-11 17:36:08 UTC (rev 636)
+++ pkg/R/methods-phylo4d.R	2009-09-11 17:41:10 UTC (rev 637)
@@ -1,4 +1,4 @@
-setMethod("tdata", "phylo4d",
+setMethod("tdata", signature(x="phylo4d"),
   function(x, type=c("tip", "internal", "allnode"),
            label.type=c("row.names","column"),
            empty.columns=TRUE, ...) {
@@ -115,8 +115,7 @@
   })
 
 setReplaceMethod("tdata", signature(x="phylo4d", value="ANY"),
-                 function(x, type = c("tip", "internal", "allnode"), ...,
-                          value) {
+ function(x, type = c("tip", "internal", "allnode"), ..., value) {
     type <- match.arg(type)
     object <- x
 
@@ -137,10 +136,11 @@
     object
 })
 
-setMethod("addData", "phylo4d", function(x, tip.data=NULL, node.data=NULL,
-                                         all.data=NULL, pos=c("after", "before"),
-                                         merge.data=TRUE, match.data=TRUE,
-                                         ...) {
+setMethod("addData", signature(x="phylo4d"),
+  function(x, tip.data=NULL, node.data=NULL,
+           all.data=NULL, pos=c("after", "before"),
+           merge.data=TRUE, match.data=TRUE,  ...) {
+
     pos <- match.arg(pos)
 
     tmpData <- .phylo4Data(x=x, tip.data=tip.data, node.data=node.data,
@@ -180,17 +180,18 @@
     x
 })
 
-setMethod("addData", "phylo4", function(x, tip.data=NULL, node.data=NULL,
-                                        all.data=NULL, pos=c("after", "before"),
-                                        merge.data=TRUE, match.data=TRUE,
-                                        ...) {
+setMethod("addData", signature(x="phylo4"),
+  function(x, tip.data=NULL, node.data=NULL,
+           all.data=NULL, pos=c("after", "before"),
+           merge.data=TRUE, match.data=TRUE, ...) {
     phylo4d(x, tip.data=tip.data, node.data=node.data, all.data=all.data,
             merge.data=merge.data, match.data=match.data, ...)
 })
 
 ## Alternative phylo4d summary method, using phylo4 summary
 ## Marguerite Butler & Peter Cowan
-setMethod("summary", "phylo4d", function(object, quiet=FALSE) {
+setMethod("summary", signature(object="phylo4d"),
+ function(object, quiet=FALSE) {
     x <- object
     res <- summary(as(x, "phylo4"), quiet=quiet)
     res$name <- deparse(substitute(object, sys.frame(-1)))
@@ -232,11 +233,13 @@
 })
 
 
-setMethod("hasTipData", signature(x="phylo4d"), function(x) {
+setMethod("hasTipData", signature(x="phylo4d"),
+ function(x) {
     nrow(x at tip.data) > 0
 })
 
-setMethod("hasNodeData", signature(x="phylo4d"), function(x) {
+setMethod("hasNodeData", signature(x="phylo4d"),
+ function(x) {
     nrow(x at node.data) > 0
 })
 



More information about the Phylobase-commits mailing list