[Phylobase-commits] r341 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Dec 19 21:32:29 CET 2008


Author: skembel
Date: 2008-12-19 21:32:29 +0100 (Fri, 19 Dec 2008)
New Revision: 341

Modified:
   pkg/R/setAs-Methods.R
Log:
Modify print method to return nodes in edge matrix order. Warning labelling broken

Modified: pkg/R/setAs-Methods.R
===================================================================
--- pkg/R/setAs-Methods.R	2008-12-19 20:32:05 UTC (rev 340)
+++ pkg/R/setAs-Methods.R	2008-12-19 20:32:29 UTC (rev 341)
@@ -110,17 +110,18 @@
     n.tip <- length(tip)
     n.int <- length(int.node)
     ## node <- c(root, node) # doesn't fit the ordering: root, other internal nodes, tips
-    node <- c(int.node, tip)
+    #node <- c(int.node, tip)
     ## retrieve the ancestor of each node
-    idx <- match(node, E[, 2]) # new ordering of the descendants/edges
+    #idx <- match(node, E[, 2]) # new ordering of the descendants/edges
     ## if (length(ancestor)>0) ancestor <- c(NA, ancestor)
-    ancestor <- E[idx, 1]
+    #ancestor <- E[idx, 1]
     ## branch.length <- c(x at root.edge, x at edge.length) # root.edge is not an edge length
-    branch.length <- edgeLength(x)[idx]
+    branch.length <- edgeLength(x)#[idx]
     if (is.null(edgeLength(x))) {
         branch.length <- rep(NA, length(node))
     }
     ## node and tip labels ##
+    ## fixme this is broken! using old assumption of order of edge matrix
     ## beware: they cannot be NULL
     ## there are always tip labels (or check_phylo4 complains)
     ## there may not be node labels (character(0))



More information about the Phylobase-commits mailing list