[Phylobase-devl] change root node from NA to 0

Jim Regetz regetz at nceas.ucsb.edu
Tue Sep 22 01:23:05 CEST 2009


Fine with me. One suggestion: In recent weeks I have changed several 
instances of this sort of thing:
   edges(x)[which(is.na(edges(x)[,1])), ]

to this:
   edges(x, drop.root=TRUE)

which accomplishes the same thing but leaves the implementation details 
to the edges method. I know for sure there are still several instances 
of the former in the code base. I suggest making sure the latter form is 
used everywhere. It would then be easy enough to update the edges method 
to match a new 0 encoding for root nodes.

On that note, would it further simplify this transition to add an 
analogous drop.root=TRUE argument to some of the other edge-related 
phylo4 methods? It would be most obviously beneficial in the case of 
edgeLength (and thus probably sumEdgeLength to match), but also possibly 
edgeLabels, edgeId, and maybe even nEdges. Just a thought.

Jim


Peter Cowan wrote:
> Given that significant changes are still fair game, I'd like to  
> propose changes the root edge from having NA as the ancestor to 0 as  
> the ancestor.
> 
> I'd be willing to do the lifting for this one, and could probably get  
> it done around the same time the unification gets finished up.
> 
> I found myself having to work around the NA issue in several places  
> where 0 wouldn't have been a problem.  Does anyone have a case where  
> NA is superior to 0 in the edge matrix?
> 
> Peter
> _______________________________________________
> Phylobase-devl mailing list
> Phylobase-devl at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/phylobase-devl
> 


More information about the Phylobase-devl mailing list