Re: [R-sig-phylo] Collapse a clade by tip labels while maintaining phylogenetic position

2016-09-15 Thread branchlizard .
Liam, Your solution worked as well! Thanks for the help and your wonderful blog post. BL On Thu, Sep 15, 2016 at 8:55 AM, Liam J. Revell wrote: > I'm sure Florian's solution works, though I haven't tried it. > > Here is another one that may work that I just posted to my

Re: [R-sig-phylo] Collapse a clade by tip labels while maintaining phylogenetic position

2016-09-15 Thread branchlizard .
Florian and list, Great ideas to use getDescendants! Worked as advertised. Thanks for the help! BL On Thu, Sep 15, 2016 at 8:55 AM, Liam J. Revell wrote: > I'm sure Florian's solution works, though I haven't tried it. > > Here is another one that may work that I just

Re: [R-sig-phylo] Collapse a clade by tip labels while maintaining phylogenetic position

2016-09-15 Thread Liam J. Revell
I'm sure Florian's solution works, though I haven't tried it. Here is another one that may work that I just posted to my blog: http://blog.phytools.org/2016/09/collapsing-clades-of-foo-huh.html All the best, Liam Liam J. Revell, Associate Professor of Biology University of Massachusetts

Re: [R-sig-phylo] Collapse a clade by tip labels while maintaining phylogenetic position

2016-09-15 Thread Florian Boucher
I don't really know what you mean by 'hard-coding', but here is what I could think of (it is probably not optimal, but should work pretty quickly if your tree does not have thousands of tips): First, borrow 'getDescendants' from phytools: getDescendants<-function(tree,node,curr=NULL){

Re: [R-sig-phylo] Collapse a clade by tip labels while maintaining phylogenetic position

2016-09-14 Thread branchlizard .
Florian and list, What is your preferred method to go about this? phy$tip.label? If so, how would one label a tip label from each clade of foo's without having to hard code the clade number? I am trying to prevent any hard coding. BL On Wed, Sep 14, 2016 at 3:46 PM, Florian Boucher

Re: [R-sig-phylo] Collapse a clade by tip labels while maintaining phylogenetic position

2016-09-14 Thread Florian Boucher
Hi Branchlizard and list, in order to do this you would first need to rename one of the foo's in each clade (I would always rename the first one) as '6 foo's', '4 foo's', etc. Then you can apply drop.tip on all the foos, as you did before. I hope this helps. Cheers, Florian 2016-09-14 21:32

Re: [R-sig-phylo] Collapse a clade by tip labels while maintaining phylogenetic position

2016-09-14 Thread branchlizard .
I would like to turn this http://i.imgur.com/chLdFmZ.jpg into this http://i.imgur.com/vSoe6mu.jpg My dataset and phylogeny is much more complex than this, but this is the basic idea. BL On Mon, Sep 12, 2016 at 8:16 PM, Liam J. Revell wrote: > I'm sure this is

Re: [R-sig-phylo] Collapse a clade by tip labels while maintaining phylogenetic position

2016-09-12 Thread Liam J. Revell
I'm sure this is possible, but I really don't understand the question. Maybe you could draw what you have in mind on a piece of paper and post a picture of the paper All the best, Liam Liam J. Revell, Associate Professor of Biology University of Massachusetts Boston web:

Re: [R-sig-phylo] Collapse a clade by tip labels while maintaining phylogenetic position

2016-09-12 Thread Hilmar Lapp
Hi BranchLizard, > On Sep 12, 2016, at 3:46 PM, branchlizard . wrote: > > I have posted this question at Stack Overflow. I hope this doesn't violate > any community rules about double posting. It doesn’t, but why not include the URL so that people can avoid answering