[Phylobase-devl] minor update

Steven Kembel skembel at berkeley.edu
Tue Sep 23 21:05:33 CEST 2008


Hi François,

Thanks for the patch. You can take out the ##FIXME comments in the  
methods-phylo4d.R code since you've now fixed them!

>  While I was playing with "tdata<-" I found what might be an unwanted
> behavior. If you do something like:
> 	tdata(geo)$tarsusL <- rData
> then rData is associated in the tip order and not using the names. It
> doesn't change the result if you would use:
>        tdata(geo, use.tip.names = T)$tarsusL <- rData
> It seems to me that there should be some error message to prevent this
> or adapt the code to make it work. I am not sure where/how to do it
> though.

The solution must be to write a method for assignment to a single  
column or subset of the tdata data.frame object, but I'm not sure how  
to do this. Currently the <- assignment method for tdata would not be  
called for tdata(obj)$foo <- bar, which is why the names are not being  
matched properly (check_data never gets called). Any S4 wizards on the  
list want to speculate how to do this?

i.e. we want a method something like the existing
setMethod("tdata<-", "phylo4d", function(object, which = c("tip",
     "node", "allnode"), ..., value) {...}
but which would work for tdata subsets created using tdata$foo or  
tdata[,foo]

Cheers,
Steve


More information about the Phylobase-devl mailing list