[Phylobase-devl] phylobase in R comparative methods course

Peter Cowan pdc at berkeley.edu
Wed Jul 23 06:39:25 CEST 2008


Marguerite,
rep() is a generic, that needs to be defined for each class. Currently there
is no definition in phylobase, which would be nice to have.  For your
purposes the following work around might do it.

hhh <- as(rtree(5), 'phylo4')
trees <- list()
for(i in 1:10) {
    trees <- c(trees, hhh)
}

HTH

Peter

On Tue, Jul 22, 2008 at 7:22 PM, Marguerite Butler <mbutler at hawaii.edu>
wrote:

> Ooops sorry!  One more question.
> One thing that I couldn't figure out was given a tree, how get the rep()
> function to make a list of duplicate trees. I just wanted to make a list of
> 10 trees, for example, and then try to modify them. Maybe there's a better
> way?
>
> Thanks,
> Marguerite
>
> On Jul 22, 2008, at 4:20 PM, Marguerite Butler wrote:
>
> Hi Folks,
>
> I will be teaching the R comparative methods workshop at NESCENT very soon.
> I know you are probably very busy trying to get everything done before
> summer ends, but if you have the time and inclination to look this over,
> please do so. Any comments at all would be greatly appreciated.
>
> I tried to show off some of the major features of phylobase, working from
> the vignette mostly. I know that there have been new developments, so if
> you'd like them featured, please send me code snippets.
>
> In general, I think the appeal to end users would be much greater if there
> were packages that use the phylo4d structure (or at least and equivalent). I
> don't know much, so maybe it's already out there? But as far as I
> understand, there's no tree+data object in ape, for example, so the best
> users can do is to take their phylo4d object, and export the phylo tree plus
> the data frame. Of course it's in the proper order and with appropriate
> labels, but being able to use it more directly would be better.
>
> The subsetting function with the [ was a little confusing at first. I had
> it stuck in my mind that you could use it to access tree elements (replacing
> the value of a branch length, for example). But I got it ... it returns a
> subtree only.
>
> Also, I consistently get this warning when I generate the Sweave document:
>
> Warning messages:
> 1: In findGeneric(nm, envir = as.environment(w)) :
>   'subset' is a formal generic function; S3 methods will not likely be
> found
>
> It would be nice if we could run the code without warnings. I'm trying to
> impress upon the students that they should write code that is error-free:).
>
> Thanks!
> Marguerite
>
> This is a very rough draft for the first part of the class which is for the
> "users".  I am still wondering if I should cut out some of the S3 S4
> content.
>
> The S3 vs. S4 classes chapter:
>
>
> <Untitled.pdf>
>
>
> The Phylobase chapter:
>
> <Untitled.pdf>
> ____________________________________________
> 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/
>
>
> ____________________________________________
> 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/
>
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.r-forge.r-project.org/pipermail/phylobase-devl/attachments/20080722/8ac17f28/attachment-0001.htm 


More information about the Phylobase-devl mailing list