countNode: count the number of nodes

View source: R/tree_countNode.R

countNodeR Documentation

count the number of nodes

Description

countNode calculates the number of nodes on a phylo tree.

Usage

countNode(tree)

Arguments

tree

A phylo object

Value

a numeric value

Author(s)

Ruizhu Huang

Examples

library(ggtree)

data(tinyTree)

ggtree(tinyTree, branch.length = 'none') +
       geom_text2(aes(label = label), hjust = -0.3) +
       geom_text2(aes(label = node), vjust = -0.8,
       hjust = -0.3, color = 'blue')


(n <- countNode(tinyTree))


fionarhuang/TreeSummarizedExperiment documentation built on June 11, 2025, 9:42 a.m.