[Phylobase-devl] labels() and other questions

Peter Cowan pdc at berkeley.edu
Sat Mar 1 04:29:44 CET 2008


Apparently I sent this to Thibaut, and not the list.

On Feb 28, 2008, at 3:11 AM, Thibaut Jombart wrote:
> 1) considering the current implementation of labels() labels(x)  
> returns
> the tip labels of 'x'), I was thinking that I would prefer to have it
> return the labels of all nodes and tips, that is, associating a  
> label to
> each number in @edge.
> Anyony voting against this modification, or having an advice?

I would guess that most of the time a user wants labels, they are  
after the tip labels.  So if we make this change it should be clear  
how you can easily get just the tip labels.  Perhaps one labels( type  
= ) command, but should the default be "all" or "tips"

> 2) Another small concern I have is about the way functions returning a
> component or a simple information about a phylo4/phylo4d are named:
> we have a "hasNodeLabels", a "nTips", or a "rootNode" but we have
> "NodeLabels" and "EdgeLength" (not "nodeLabels" and "edgeLength") to
> give a few examples. This is annoying when looking for a function...
> like typing "node" then [tab][tab] does not list all 'node' functions.
> Another related issue is about already existing functions, i.e. from  
> the
> required packages. Looking for node labels, I was mislead by ape's
> functions "tiplabels", "nodelabels" and "edgelabels" which actually  
> do a
> different job (add labels to a plot).
>
> In an ideal world, I guess, we would be using a generic
> way-of-naming-functions... any idea about what we can do in the real  
> world?

I agree that the current naming is a bit confusing.  Bioconductor  
suggests using camelCase for functions.  We could follow that  
nomecalture.

To follow up on that why do we have the function hasNodeLabels?  I  
suspect most of the time I would personally do something like:

length(NodeLables(foo)) == 0

I worry that users will be swamped with commands. Should we make these  
private, remove them, or am I missing something?

For tree walking, I prefer descendants/ancestors...

Peter



More information about the Phylobase-devl mailing list