[Phylobase-commits] r506 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 19 18:46:13 CEST 2009


Author: bbolker
Date: 2009-08-19 18:46:13 +0200 (Wed, 19 Aug 2009)
New Revision: 506

Modified:
   pkg/R/methods-phylo4d.R
Log:
  changed identical(x,unique(x))  to !any(duplicated(data.names)) -- avoid
 false flag on named vs. unnamed vectors



Modified: pkg/R/methods-phylo4d.R
===================================================================
--- pkg/R/methods-phylo4d.R	2009-08-19 16:43:34 UTC (rev 505)
+++ pkg/R/methods-phylo4d.R	2009-08-19 16:46:13 UTC (rev 506)
@@ -20,9 +20,9 @@
           }
           tdata <- x at tip.data
           data.names <- tipLabels(x)
-          if ( identical(label.type, "row.names") ) {
-              if ( identical(data.names, unique(data.names)) &&
-                  !(any(is.na(data.names))) ) {
+          if ( label.type ==  "row.names" ) {
+              if (!any(duplicated(data.names)) &&
+                  !any(is.na(data.names)) ) {
                   row.names(tdata) <- data.names
               }
               else {



More information about the Phylobase-commits mailing list