Return the taxon ranks in a taxonomy() or taxmap() object. They are in the order taxa appear in the edge list.

obj$taxon_ranks()
taxon_ranks(obj)

Arguments

obj

The taxonomy() or taxmap() object.

See also

Examples

# Get ranks for each taxon taxon_ranks(ex_taxmap)
#> b c d e f g h i #> "class" "kingdom" "family" "family" "family" "family" "genus" "genus" #> j k l m n o p q #> "genus" "genus" "genus" "species" "species" "species" "species" "species" #> r #> "species"
# Filter by rank filter_taxa(ex_taxmap, taxon_ranks == "family", supertaxa = TRUE)
#> <Taxmap> #> 6 taxa: b. Mammalia, c. Plantae ... f. Hominidae, g. Solanaceae #> 6 edges: NA->b, NA->c, b->d, b->e, b->f, c->g #> 4 data sets: #> info: #> # A tibble: 6 x 4 #> taxon_id name n_legs dangerous #> <chr> <chr> <dbl> <lgl> #> 1 d tiger 4 TRUE #> 2 d cat 4 FALSE #> 3 e mole 4 FALSE #> # … with 3 more rows #> phylopic_ids: a named vector of 'character' with 6 items #> d. e148eabb-f138-43[truncated] ... g. 63604565-0406-46[truncated] #> foods: a list of 6 items named by taxa: #> d, d, e, f, g, g #> abund: #> # A tibble: 8 x 5 #> taxon_id code sample_id count taxon_index #> <chr> <fct> <fct> <dbl> <int> #> 1 d T A 1 1 #> 2 d C A 2 2 #> 3 e M B 5 3 #> # … with 5 more rows #> 1 functions: #> reaction