treeTrimmer | R Documentation |
This function returns a phylo or multiPhylo object that has been pruned to include only specified taxa. Note: Function will STOP if any 'tree' is missing any 'taxa' or if trimming will result in <2 final taxa
treeTrimmer(tree, taxa, remove)
tree |
Tree(s) to trim. Options include:
|
taxa |
Character vector (or semicolon-separated list) of desired tip labels to keep (or discard if remove=TRUE) |
remove |
OPTIONAL: If TRUE, tip labels specified by 'taxa' are removed from all trees rather than retained [Default: FALSE, prune 'tree' down to 'taxa'] |
Pruned phylo or multiPhylo object
# myTree is a phylo object with 4 tips
desiredTaxa <- c('Species_1','Species_2','Species_3')
undesiredTaxa <- 'Species_4'
trimmedTree <- treeTrimmer(myTree,desiredTaxa) # Trim myTree down to taxa in 'desiredTaxa'
trimmedTree <- treeTrimmer(myTree,undesiredTaxa,remove=TRUE) # Remove 'undesiredTaxa' from myTree
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.