Learn R Programming

pacha (version 0.1.1)

threat_status_pacha: Retrieve conservation threat status

Description

Retrieves the conservation-status value documented for a taxon. The API source reads the ChecklistBank taxon-distribution endpoint; the local source reads Distribution.tsv using the same country-aware, deterministic selection rule as establishment_pacha(). Typical values are IUCN categories such as EX, EW, CR, EN, VU, NT, LC, DD, and NE, though the function accepts any status recorded in the underlying dataset.

Usage

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

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

Value

threat_status_pacha() prints and invisibly returns a translated conservation-status category, or the localized no-data/connection message. threat_status_pacha_md() returns, invisibly, the emitted Markdown string, or "" when the source has no threat-status record.

Arguments

species

Character scalar containing at least a genus and specific epithet.

language

Optional output-language code or alias used to translate the threat category and 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.

Details

Values are translated through the selected language dictionary's threat mapping. Unmapped source values are returned in sentence case rather than rejected, so alternative assessment schemes remain usable.

See Also

accessors-pacha for a detailed description of plain-text and Markdown accessors.

Examples

Run this code
if (FALSE) {
threat_status_pacha("Bidens andicola")
threat_status_pacha("Bidens andicola", source = "coldp", language = "en")
}
if (FALSE) {
threat_status_pacha_md("Bidens andicola", language = "en")
}

Run the code above in your browser using DataLab