Re: [R-sig-phylo] A test for valid phylo object (ape package) for package developers

2019-11-07 Thread Emmanuel Paradis
Hi, To answer Elizabeth's question: there is no function that does what you asked for in your first message. Liam's solution is certainly the best solution for the moment. I'll have a look at it later. The code checkValidPhylo() needs to be dusted off a bit: the diagnostic " MODERATE: some

Re: [R-sig-phylo] A test for valid phylo object (ape package) for package developers

2019-11-05 Thread Elizabeth Purdom
Thank you very much, I’ll try that! > On Nov 5, 2019, at 2:20 PM, Liam Revell wrote: > > Hi Elizabeth. > > This does not do exactly what you want, but it is possible to use > capture.output() to grab the printout of checkValidPhylo() and then > grep() to see if it contains instances of

Re: [R-sig-phylo] A test for valid phylo object (ape package) for package developers

2019-11-05 Thread David Bapst
Hi Elizabeth, There's a lot of ways for trees to be wrong, and surely no tree-checking or tree-fixing function can handle all possibilities. Dating trees and simulating trees can be a messy business, so I used to often hard-crash R with C++ errors all the time until I wrote functions to try to

Re: [R-sig-phylo] A test for valid phylo object (ape package) for package developers

2019-11-05 Thread Liam Revell
Hi Elizabeth. This does not do exactly what you want, but it is possible to use capture.output() to grab the printout of checkValidPhylo() and then grep() to see if it contains instances of "MODERATE" or "FATAL" errors. The following simple function does that. It returns 0 if neither MODERATE