tree_subset: Create a subtree by specifying tips to keep.

tree_subsetR Documentation

Create a subtree by specifying tips to keep.

Description

Create a subtree by specifying tips to keep.

Usage

tree_subset(tree, tips)

Arguments

tree

A phylo object, as returned from read_tree().

tips

A character, numeric, or logical vector of tips to keep.

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


cmmr/rbiom documentation built on April 28, 2024, 6:38 a.m.