unionLeaf: list leaf nodes that are the descendants of at least one...

Description Usage Arguments Value Examples

View source: R/tree_unionLeaf.R

Description

unionLeaf list the leaf nodes that are the desendants of (at least one) specified nodes.

Usage

1
unionLeaf(tree, node)

Arguments

tree

A phylo object.

node

A numeric or character vector. It specifies internal nodes that are changed to leaves via their node labels or numbers.

Value

A phylo object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(ggtree)
data(tinyTree)
ggtree(tinyTree, ladderize = FALSE) +
    geom_text2(aes(label = label), color = "darkorange",
           hjust = -0.1, vjust = -0.7) +
    geom_text2(aes(label = node), color = "darkblue",
               hjust = -0.5, vjust = 0.7) +
    geom_hilight(node = 18) +
    geom_point2()

u1 <- unionLeaf(tree = tinyTree, node = c(19, 17))
u2 <- unionLeaf(tree = tinyTree, node = c(19, 17, 7))
(u3 <- unionLeaf(tree = tinyTree, node = c(11, 17, 7)))

TreeSummarizedExperiment documentation built on Dec. 8, 2020, 2 a.m.