View source: R/write_taxa_map.R
write_taxa_map | R Documentation |
This function takes a data frame of taxa names and joins them
with ITIS data from a local taxadb database, producing a standardized taxa
map suitable for downstream workflows. The function preserves input order,
checks for duplicate matches and row count consistency (with warnings), and
writes the result to taxa_map.csv
.
write_taxa_map(taxa_df, taxa_col)
taxa_df |
A data frame containing taxa names to be mapped. |
taxa_col |
The unquoted column name in |
The function uses helper functions to connect to the taxadb
database, retrieve the ITIS table, and determine the correct table name. It
uses taxadb::clean_names()
to standardize input names and
dplyr
for data manipulation. Validation is performed using
pointblank
to warn about duplicate matches and row count mismatches.
Invisibly returns the taxa map data frame (also written to
taxa_map.csv
).
## Not run:
sample_taxa <- data.frame(scientific_name = c("Homo sapiens", "Panthera"))
write_taxa_map(sample_taxa, scientific_name)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.