[R-sig-phylo] pruning a tree

2013-04-05 Thread Elaine Kuo
Hello This Elaine. I tried to prune a phylogeny tree using two methods based on the code attached. Method 1 returned the tip.label sharing between birddata and birdtree. Method 2 returned nothing. Please kindly indicate why Method 2 failed to prune the tree. Also, please kindly

Re: [R-sig-phylo] pruning a tree

2013-04-05 Thread Liam J. Revell
Hi Elaine. A simpler way to do method 1 that doesn't require na.omit or match is: # if there are species in the tree that are missing from the data: ss-species.to.keep[,1] # species in the data tree-birdtree tree.pruned-drop.tip(tree,setdiff(tree$tip.label,ss)) I would guess that method 2

Re: [R-sig-phylo] Pruning a tree

2011-03-04 Thread Eugen Egorov
- Original Message - From: Graham Slater gsla...@ucla.edu To: Eugen Egorov eugen...@online.de Cc: r-sig-phylo@r-project.org Sent: Thursday, March 03, 2011 7:54 PM Subject: Re: [R-sig-phylo] Pruning a tree drop.tip assumes you have identified the tips that you want to remove, which you could do

Re: [R-sig-phylo] Pruning a tree

2011-03-04 Thread Liam J. Revell
Slater gsla...@ucla.edu To: Eugen Egorov eugen...@online.de Cc: r-sig-phylo@r-project.org Sent: Thursday, March 03, 2011 7:54 PM Subject: Re: [R-sig-phylo] Pruning a tree drop.tip assumes you have identified the tips that you want to remove, which you could do using nc - name.check(tree, data

Re: [R-sig-phylo] Pruning a tree

2011-03-04 Thread Graham Slater
- Original Message - From: Graham Slater gsla...@ucla.edu To: Eugen Egorov eugen...@online.de Cc: r-sig-phylo@r-project.org Sent: Thursday, March 03, 2011 7:54 PM Subject: Re: [R-sig-phylo] Pruning a tree drop.tip assumes you have identified the tips that you want to remove

Re: [R-sig-phylo] Pruning a tree

2011-03-04 Thread Eugen Egorov
...for whatever reason... Does that make any sense? - Original Message - From: Graham Slater gsla...@ucla.edu To: Liam J. Revell liam.rev...@umb.edu Cc: Eugen Egorov eugen...@online.de; r-sig-phylo@r-project.org Sent: Friday, March 04, 2011 6:33 PM Subject: Re: [R-sig-phylo] Pruning a tree

Re: [R-sig-phylo] Pruning a tree

2011-03-04 Thread Liam J. Revell
, 2011 6:33 PM Subject: Re: [R-sig-phylo] Pruning a tree Yes, name.check() will only work with a named vector of data or data frame, so Liam's code should work for you. it also looks like your names in the vector species are different from those of the tip labels, as you say that nc$Tree.not.data

[R-sig-phylo] Pruning a tree

2011-03-03 Thread Eugen Egorov
Hi all, I have a huge tree and a list with species. Now I want to prune the tree, so only species appearing in the list are left in the tree. I tried the geiger package to compare tree species with those in the list, but that didn't work out, because I recieved a tree with 0 tips and 1 node