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

Jim Regetz regetz at nceas.ucsb.edu
Thu Sep 24 02:34:24 CEST 2009


Ben Bolker wrote:
> Peter Cowan wrote:
> 
>> One remaining question: getNode(NA) would return NA but getNode(0)  
>> returns 0, is this the desired behavior?
> 
>    NA feels more intuitive to me, both are reasonable, I haven't thought
> through consequences very much.

I would strongly vote for NA. I definitely view 0 not as a node, but 
simply as a placeholder for the ancestral end of the root edge. As far 
as I know, everything else in the phylobase code jives with this 
assertion. So if getNode gets nodes, and 0 is not actually a node, then 
getNode(0) should return NA just like getNode(-999) would.

Or to put it another way, my expectation has always been that calling 
getNode on any value in the set nodeId(phy, "all") (which doesn't and 
shouldn't include) should return a valid node, but calling getNode on 
any integer *not* in that set should return NA.

Thanks for the efforts on this!

Jim


More information about the Phylobase-devl mailing list