isLeaf: To test whether the specified nodes are leaf nodes

Description Usage Arguments Value Author(s) Examples

Description

isLeaf is to test wheter some specified nodes are leaf nodes of a tree.

Usage

1
isLeaf(tree, input)

Arguments

tree

A phylo object.

input

A numeric or character vector. Node labels or node numbers.

Value

a logical vector with the same length as input

Author(s)

Ruizhu HUANG

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(tinyTree)
library(ggtree)

# PLOT tree
# The node labels are in orange texts and the node numbers are in blue
ggtree(tinyTree,branch.length = 'none')+
    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)

isLeaf(tree = tinyTree, input = c(5, 4, 18))
isLeaf(tree = tinyTree, input = c("t4", "t9", "Node_18" ))

markrobinsonuzh/treeAGG documentation built on May 26, 2019, 9:32 a.m.