keep_tips | R Documentation |
Prune a tree or a collection of trees and keep only requested tips.
keep_tips(x, tips)
## S3 method for class 'phylo'
keep_tips(x, tips)
## S3 method for class 'multiPhylo'
keep_tips(x, tips)
## S3 method for class 'rankedPhylo'
keep_tips(x, tips)
x |
a tree of class "phylo" or "multiPhylo" |
tips |
tip labels to keep |
a pruned tree or a collection
tree = rankedPhylo(5)
# select randomly 3 tips to keep
tips = sample(tips(tree), 3)
keep_tips(tree, tips)
trees = rankedPhylo(3:7)
# get tips from the first tree
tips = tips(trees[[1]])
# prune all trees, all of them will have 3 tips
keep_tips(trees, tips)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.