taxa (version 0.4.3)

is_leaf: Check if taxa are leaves

Description

Check if each taxon is a leaf. A leaf is a taxon with no subtaxa. subtaxa.

Usage

is_leaf(x)

Arguments

x

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

See Also

Other leaf functions: leaves(), n_leaves()

Examples

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

Run the code above in your browser using DataLab