[Phylobase-devl] change root node from NA to 0
Peter Cowan
pdc at berkeley.edu
Thu Sep 24 19:23:14 CEST 2009
Thanks all for the feedback. I'm happy to make that change. However,
it will cause the following to no longer be true:
In the runit.setAs-Methods.R
test..phylo4ToDataFrame <- function() {
checkIdentical(phy.show$ancestor, ancestor[match(c(nid.tip, nid.int),
descendant)])
}
In this case the ancestor vector is used to build an edge matrix (e.g.
is contains 0) and phy.show$ancestor is the output from setAs(phy,
dataframe) and uses getNode() -- thus containing NA.
How should this be handled?
btw thanks for all the unit tests guys!!
Peter
On Sep 24, 2009, at 10:01 AM, François Michonneau wrote:
>
> I agree, it should return NA.
> -- François
>
>
> On Wed, 2009-09-23 at 17:34 -0700, Jim Regetz wrote:
>> 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
>> _______________________________________________
>> 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
> _______________________________________________
> 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