Sam,

In order to run on one tree try "phy=trees[[1]]", otherwise you will need
to run a loop of the function over all the trees.

e.g.

for(i in 1:length(trees)){

phy <- trees[[i]]

then code as normal

Nick


On Tue, Apr 30, 2013 at 7:33 AM, Samantha DelSerra <s.delse...@gmail.com>wrote:

> Hello,
>
> I am trying to analyse 100 trees against morphological continuous data
> using a phylogenetic GLS. I'm using the comparative.data function in order
> to do this, but I keep getting an error saying that the class must be
> phylo. I understand that my data is multiphylo, but is there a way to
> convert this data into the phylo class? Below is my code and the error
> message.
>
> > trees <- read.nexus("testrees1.tree")
> > bats <- comparative.data(phy = trees, data = corr.data, names.col =
> Phyloname, vcv = TRUE, na.omit = FALSE, warn.dropped = TRUE)
> Error in comparative.data(phy = trees, data = corr.data, names.col =
> Phyloname,  :
>   'trees' not of class 'phylo'
>
> Thanks very much!
> Sam
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at
> http://www.mail-archive.com/r-sig-phylo@r-project.org/
>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to