Re: [R-sig-phylo] Force read.nexus() to return a multiPhylo object, even if there is only one tree

2016-12-27 Thread Liam J. Revell
Hi Yan. In case it is useful I just pushed an update to phytools in which I have added an as.multiPhylo method for objects of class "phylo". This will also return an object of class "multiPhylo" if that is already the object class. This means that: obj<-as.multiPhylo(read.nexus(...)) in

[R-sig-phylo] Force read.nexus() to return a multiPhylo object, even if there is only one tree

2016-12-27 Thread Yan Wong
Hi I’m doing some analysis in which I produce a variable number of phylogenetic trees with the same tips in a nexus file, then import them into R for analysis (these are trees along a genome). The name of each tree is meaningful (it is a position along the genome). However, in a few

Re: [R-sig-phylo] Force read.nexus() to return a multiPhylo object, even if there is only one tree

2016-12-27 Thread Emmanuel Paradis
Hi Yan, Yes, you are right: this modification can be done. In the meantime, you can fix the code with: fix(read.nexus) Find this line (#117): if (Ntree == 1) { and change it to: if (FALSE) { save and close. Tell me if you still have problem. Best, Emmanuel Le 27/12/2016 à

Re: [R-sig-phylo] Force read.nexus() to return a multiPhylo object, even if there is only one tree

2016-12-27 Thread Yan Wong
On 27 Dec 2016, at 22:08, Emmanuel Paradis wrote: > Hi Yan, > > Yes, you are right: this modification can be done. In the meantime, you can > fix the code with: > > fix(read.nexus) > > Find this line (#117): > >if (Ntree == 1) { > > and change it to: > >