Learn R Programming

pacha (version 0.1.1)

common_names_pacha: Retrieve common names

Description

Retrieves vernacular names for a scientific name from the currently configured source. The API source queries the configured ChecklistBank dataset; the local source reads VernacularName.tsv from the configured ColDP archive and, when a country column is present, keeps only the entries matching coldp_country. Names are grouped by language in the returned value. The examples below use the Ecuadorian checklist dataset configured by default, but the same calls work against any compatible ChecklistBank dataset or ColDP archive.

Usage

common_names_pacha(species, language = NULL, source = NULL, refresh = FALSE)

common_names_pacha_md(species, language = NULL, source = NULL, refresh = FALSE)

Value

common_names_pacha() prints and invisibly returns a single character string of names grouped by language, or the localized no-data/connection message. common_names_pacha_md() returns, invisibly, the emitted Markdown string, or "" when no names are available.

Arguments

species

Character scalar containing at least a genus and specific epithet.

language

Optional output-language code or alias used for labels.

source

Optional source override: "api"/"web" or "coldp"/"local". NULL uses the configured default ("api").

refresh

Logical scalar. If TRUE, fetches the selected source again instead of reusing its cached record.

See Also

accessors-pacha for how plain-text and Markdown accessors work.

Examples

Run this code
if (FALSE) {
common_names_pacha("Bidens andicola")
common_names_pacha("Bidens andicola", source = "coldp")
}
if (FALSE) {
common_names_pacha_md("Bidens andicola")
}

Run the code above in your browser using DataLab