[Phylobase-commits] r504 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 19 17:57:13 CEST 2009


Author: francois
Date: 2009-08-19 17:57:12 +0200 (Wed, 19 Aug 2009)
New Revision: 504

Modified:
   pkg/R/methods-phylo4.R
   pkg/R/methods-phylo4d.R
Log:
fix/work around bug #574

Modified: pkg/R/methods-phylo4.R
===================================================================
--- pkg/R/methods-phylo4.R	2009-08-19 15:16:15 UTC (rev 503)
+++ pkg/R/methods-phylo4.R	2009-08-19 15:57:12 UTC (rev 504)
@@ -227,6 +227,7 @@
    function(object, type = c("tip", "internal", "allnode"),
             use.names=FALSE, ..., value) {
 
+       if(missing(type)) type <- "tip"
        type <- match.arg(type)
 
        ob <- switch(type,

Modified: pkg/R/methods-phylo4d.R
===================================================================
--- pkg/R/methods-phylo4d.R	2009-08-19 15:16:15 UTC (rev 503)
+++ pkg/R/methods-phylo4d.R	2009-08-19 15:57:12 UTC (rev 504)
@@ -21,7 +21,7 @@
           tdata <- x at tip.data
           data.names <- tipLabels(x)
           if ( identical(label.type, "row.names") ) {
-              if ( identical(data.names, unique(data.names)) ||
+              if ( identical(data.names, unique(data.names)) &&
                   !(any(is.na(data.names))) ) {
                   row.names(tdata) <- data.names
               }
@@ -209,19 +209,7 @@
     nrow(x at node.data) > 0
 })
 
-setReplaceMethod("nodeLabels", "phylo4d", function(object, ...,
-    value) {
-    object at node.label <- value
-    #rownames(object at node.data) <- value
-    object
-})
 
-setReplaceMethod("labels", "phylo4d", function(object, ..., value) {
-    object at tip.label <- value
-    #rownames(object at tip.data) <- value
-    object
-})
-
 ## FIXME: doesn't deal with missing node data
 ##   (don't even know how that should be done in this case)
 setMethod("na.omit", "phylo4d", function(object, ...) {



More information about the Phylobase-commits mailing list