subtree {rbiom}R Documentation

Create a subtree by specifying tips to keep.

Description

Create a subtree by specifying tips to keep.

Usage

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

    library(rbiom)
    
    infile <- system.file("extdata", "newick.tre", package = "rbiom")
    tree <- read.tree(infile)
    
    leafs   <- tips(tree)
    subtree <- subtree(tree, head(leafs))


[Package rbiom version 1.0.3 Index]