Extract the last rank of a lineage
Arguments
- lineage
string. Vector of lineages.
- same
logical. Does the lineage have the same depth? Default to
TRUE
.
Examples
lineage1 <- "k__Bacteria|p__Verrucomicrobia|c__Verrucomicrobiae"
lineage2 <- "k__Bacteria|p__Firmicutes|c__Clostridia"
get_last_rank(c(lineage1, lineage2))
#> [1] "class" "class"