Learn R Programming

rbiom (version 1.0.3)

subtree: Create a subtree by specifying tips to keep.

Description

Create a subtree by specifying tips to keep.

Usage

subtree(tree, tips)

Value

A phylo object for the subtree.

Arguments

tree

A phylo object, as returned from read.tree.

tips

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

Examples

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

Run the code above in your browser using DataLab