n_leaves: Number of leaves per taxon

View source: R/taxonomy.R

n_leavesR Documentation

Number of leaves per taxon

Description

Get the number of leaves per taxon. A leaf is a taxon with no subtaxa.

Usage

n_leaves(x)

Arguments

x

The object to get leaves for, such as a taxonomy object

See Also

Other leaf functions: is_leaf(), leaves()

Examples

x <- taxonomy(c('Carnivora', 'Felidae', 'Panthera', 'Panthera leo',
                'Panthera tigris', 'Ursidae', 'Ursus', 'Ursus arctos'),
              supertaxa = c(NA, 1, 2, 3, 3, 1, 6, 7))
n_leaves(x)


ropenscilabs/taxa documentation built on Feb. 23, 2024, 6:31 p.m.