tip_descendants: Get all the descendants that are tips

Description Usage Arguments Value Examples

View source: R/prep_data.R

Description

This is a helper for tree_sum, which gets the names of tip nodes that descend from a specified internal node, given an edgelist specifying the tree structure.

Usage

1
tip_descendants(el, cur_node)

Arguments

el

[character matrix] A matrix specifying the tree structure. The first column are character names for the parents, the second are children.

cur_node

[character] The name of the internal node to search for descendants from. The name must appear in el.

Value

tips [character vector] A character vector of tip nodes that descend from cur_node.

Examples

1
2
3
4
5
library("phyloseq")
data(GlobalPatterns)
GP <- subset_taxa(GlobalPatterns, Phylum=="Chlamydiae")
el <- phy_tree(GP)$edge
tip_descendants(el, 34)

krisrs1128/treelapse documentation built on Jan. 3, 2020, 6:29 p.m.