Hi Silvia. Are you using outgroup rooting? If so, this should work with the following:
trees<-lapply(unclass(trees),root,outgroup="outgroupname") class(trees)<-"multiPhylo" You can also give lapply any of the other arguments in root, for instance: trees<-lapply(unclass(trees),root,outgroup="outgroupname",resolve.root=TRUE) Let us know if that does not work. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytools.org On 8/6/2013 2:03 PM, SILVIA CALVO ARANDA wrote:
Hi! I want to root several trees in the same file to then use it for character reconstruction taking phylogenetic uncertainty into account. root() from ape package requires an object of class 'Phylo' but i can only import my dataset into 'multiPhylo'. i need to apply the root function to each one of the trees included in the nexus file. lapply() is probably useful to this aim but i'm not able to get the correct script Any idea will be good for me! thanks in advance Silvia [[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/
_______________________________________________ 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/