
Last chance! 50% off unlimited learning
Sale ends in
Annotate a custom taxonomy
annotate(x, names, new_column, present = "1", absent = NA)
A tibble with taxonomic data to be annotated.
A character vector containing scientific names.
A string to be the name of a new column that will contain annotations.
A string with the annotation in the case of a match (Defaults to "1").
A string with the annotation in case of no match (Defaults to NA).
A tibble that contains an additional column with annotations.
This method takes as input a character vector with scientific names. If the scientific name(s) in the vector match with scientific names in the tibble, a new column will be created and an annotation of choice will be added to the relevant row in the new column. This method is useful for annotating scientific names with identified ambiguity, duplication or any other characteristic. The character vector could, for example, even contain scientific names that have not been derived with a Taxonbridge method.
# NOT RUN {
sample <- load_sample()
lineages <- get_lineages(sample)
kingdom <- get_validity(lineages, rank = "kingdom", valid = FALSE)
family <- get_validity(lineages, rank = "family", valid = FALSE)
candidates <- list(kingdom, family)
binomials <- get_inconsistencies(candidates, uninomials = FALSE, set = "intersect")
x <- annotate(sample, binomials, new_column = "inconsistencies", "Accepted but ambigious")
x[!is.na(x$inconsistencies),c("inconsistencies")]
# }
Run the code above in your browser using DataLab