findExcl: Find branches that are non-overlapping with specified...

View source: R/tree_findExcl.R

findExclR Documentation

Find branches that are non-overlapping with specified branches in a tree

Description

Find all branches whose leaves do not overlap with those of the specified branches.

Usage

findExcl(tree, node, use.alias = FALSE)

Arguments

tree

A phylo object.

node

A numeric or character vector specifying the nodes.

use.alias

A logical scalar. If TRUE, the alias name is used to name the output vector.

Value

A vector of node numbers

Author(s)

Ruizhu Huang

Examples

suppressPackageStartupMessages({
    library(ggtree)
    library(TreeSummarizedExperiment)
})

data(tinyTree)
ggtree(tinyTree, branch.length = "none") +
    geom_text2(aes(label = node)) +
    geom_hilight(node = 17, fill = "blue", alpha = 0.3) +
    geom_hilight(node = 13, fill = "orange", alpha = 0.3)

## Find branches whose leaves do not overlap with the two colored branches.
## The returned branches are represented at the highest tree level
## possible without including any of the forbidden branches.
findExcl(tree = tinyTree, node = c(17, 13))


fionarhuang/treeclimbR documentation built on Nov. 7, 2024, 4:17 a.m.