subtree: Create a subtree by specifying tips to keep.

Description Usage Arguments Value Examples

Description

Create a subtree by specifying tips to keep.

Usage

1
subtree(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.

Examples

1
2
3
4
5
6
7
    library(rbiom)
    
    infile <- system.file("extdata", "newick.tre", package = "rbiom")
    tree <- read.tree(infile)
    
    leafs   <- tips(tree)
    subtree <- subtree(tree, head(leafs))

rbiom documentation built on Nov. 5, 2021, 9:11 a.m.