[Phylobase-devl] labels() and other questions

Marguerite Butler mbutler at hawaii.edu
Fri Feb 29 18:09:57 CET 2008


On Feb 28, 2008, at 1:11 AM, Thibaut Jombart wrote:

> Hi phylobasists,
>
> 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?
>

YES! A strong vote in favor of returning all node labels (internal +  
tip). I personally get very confused about the numbering of nodes on  
the tree, and this would help avoid a serious mistake. I would really  
like to avoid breaking up the structure of the data object into  
pieces, it's safer to keep it whole. Especially since labels() is so  
generic.. it's not tip.labels() after all, so I would expect the  
default behavior to return all labels anyway.

Perhaps one solution would be to have an option labels( tree,  
tips.only=FALSE)  or a type="tips", "internal", etc.?


> 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?
>

We definitely need some consistency. It is not obvious to me what the  
scheme should be however. The lower case form looks more like  
conventional R code, but I don't have a strong feeling as long as it  
is a coherent system.

We should probably fix this before it goes further and gets more out  
of hand, though.

Marguerite

> Cheers,
>
> Thibaut.
>
>
> _______________________________________________
> 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

____________________________________________
Marguerite A. Butler
Department of Zoology
University of Hawaii
2538 McCarthy Mall, Edmondson 259
Honolulu, HI  96822

Phone: 808-956-4713
FAX:   808-956-9812
Dept: 808-956-8617
http://www2.hawaii.edu/~mbutler
http://www.hawaii.edu/zoology/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.r-forge.r-project.org/pipermail/phylobase-devl/attachments/20080229/32dd201f/attachment.htm 


More information about the Phylobase-devl mailing list