Test if a lineage goes down to a specified rank
Arguments
- lineage
string. Vector of lineages.
- rank
string. One of
c("kingdom", "phylum", "class", "order", "family", "genus", "species", "strain")
with partial matching.
Examples
lineage1 <- "k__Bacteria|p__Verrucomicrobia|c__Verrucomicrobiae"
lineage2 <- "k__Bacteria|p__Firmicutes|c__Clostridia"
is_rank(c(lineage1, lineage2), "class")
#> [1] TRUE TRUE
is_rank(c(lineage1, lineage2), "order")
#> [1] FALSE FALSE
is_at_least_rank(c(lineage1, lineage2), "phylum")
#> [1] TRUE TRUE
is_at_least_rank(c(lineage1, lineage2), "order")
#> [1] FALSE FALSE