Extract the last clade of a lineage
last_clade(lineage, same = TRUE)
string. Vector of lineages.
logical. Does the lineage have the same depth? Default to TRUE.
A string. The last clades of the given lineages.
lineage1 <- "k__Bacteria|p__Verrucomicrobia|c__Verrucomicrobiae"
lineage2 <- "k__Bacteria|p__Firmicutes|c__Clostridia"
last_clade(c(lineage1, lineage2))
#> [1] "Verrucomicrobiae" "Clostridia"