Get number of subtaxa for each taxon in an object of type taxonomy() or taxmap(), not including subtaxa of subtaxa etc. This does not include subtaxa assigned to subtaxa.

obj$n_subtaxa_1()
n_subtaxa_1(obj)

Arguments

obj

(taxonomy() or taxmap())

Value

numeric

See also

Examples

# Count number of immediate subtaxa in each taxon n_subtaxa_1(ex_taxmap)
#> b c d e f g h i j k l m n o p q r #> 3 1 2 1 1 1 1 1 1 1 2 0 0 0 0 0 0
# Filter taxa based on number of subtaxa # (this command removed all leaves or "tips" of the tree) filter_taxa(ex_taxmap, n_subtaxa_1 > 0)
#> <Taxmap> #> 11 taxa: b. Mammalia, c. Plantae ... k. homo, l. Solanum #> 11 edges: NA->b, NA->c, b->d, b->e ... d->i, e->j, f->k, g->l #> 4 data sets: #> info: #> # A tibble: 6 x 4 #> taxon_id name n_legs dangerous #> <chr> <chr> <dbl> <lgl> #> 1 h tiger 4 TRUE #> 2 i cat 4 FALSE #> 3 j mole 4 FALSE #> # … with 3 more rows #> phylopic_ids: a named vector of 'character' with 6 items #> h. e148eabb-f138-43[truncated] ... l. 63604565-0406-46[truncated] #> foods: a list of 6 items named by taxa: #> h, i, j, k, l, l #> abund: #> # A tibble: 8 x 5 #> taxon_id code sample_id count taxon_index #> <chr> <fct> <fct> <dbl> <int> #> 1 h T A 1 1 #> 2 i C A 2 2 #> 3 j M B 5 3 #> # … with 5 more rows #> 1 functions: #> reaction