Parses species codes in input data and matches them with the BETY species ID.
Usage
match_species_id(
input_codes,
format_name = "custom",
bety = NULL,
translation_table = NULL,
...
)Value
data.frame containing the following columns:
input_codeCharacter provided as input
bety_species_idBig integer species ID, unique and specific to BETY
genusGenus part of Latin name, from BETY
speciesSpecies part of Latin name, from BETY
Details
format_name can be one of the following:
usdaUSDA Plants database symbol (e.g. QURU, TSCA)
fiaFIA species code
latin_nameScientific name, as "Genus species"; must match exactly and unambiguously to
scientificnamefield in BETYcustomA data frame matching BETY IDs (column name
bety_species_id) to input codes (column nameinput_code). This data frame must be passed via thetranslation_tableargument.
Examples
if (FALSE) { # \dontrun{
con <- PEcAn.DB::db.open(list(
driver = "Postgres",
dbname = 'bety',
user = 'bety',
password = 'bety',
host = 'localhost')
)
input_codes <- c('ACRU', 'PIMA', 'TSCA')
format_name <- 'usda'
match_species_id(input_codes = input_codes,
format_name = format_name,
bety = con)
} # }