tree_subset {rbiom} | R Documentation |
Create a subtree by specifying tips to keep.
Description
Create a subtree by specifying tips to keep.
Usage
tree_subset(tree, tips, underscores = FALSE)
Arguments
tree |
A phylo object, as returned from |
tips |
A character, numeric, or logical vector of tips to keep. |
underscores |
When parsing the tree, should underscores be kept as
is? By default they will be converted to spaces (unless the entire ID
is quoted). Default |
Value
A phylo
object for the subtree.
See Also
Other phylogeny:
read_tree()
Examples
library(rbiom)
infile <- system.file("extdata", "newick.tre", package = "rbiom")
tree <- read_tree(infile)
tree
subtree <- tree_subset(tree, tips = head(tree$tip.label))
subtree
[Package rbiom version 2.2.1 Index]