Learn R Programming

pacha (version 0.1.1)

pacha_sc_full_name: Full scientific name of a species

Description

Resolves species against ChecklistBank's Catalogue of Life dataset ("3LXR") via match/nameusage, falling back to nameusage/search (limit = 100) when no direct match is returned. Among search candidates the best match is chosen by preference: an exact case-insensitive name match with status "accepted"; else any exact name match; else the first "accepted" candidate; else the first candidate returned. pacha_sc_full_name returns the name as plain text; pacha_sc_full_name_md renders it as a Markdown heading (see "Functions"). This resolution always uses dataset "3LXR" and ignores pacha_configure().

Usage

pacha_sc_full_name(species)

pacha_sc_full_name_md(species)

Value

Character scalar: "Genus species Authorship" if authorship resolved, otherwise "Genus species" (or the original species if resolution failed). See "Functions" for the Markdown variant.

Arguments

species

Character scalar: a validated binomial name (non-NA, non-empty, at least two whitespace-separated tokens). Internal whitespace is collapsed and the string trimmed before use.

Functions

  • pacha_sc_full_name_md(): Same resolution, rendered as a Markdown heading with the name italicised and the authorship appended as plain text (e.g. "## *Bidens andicola* Kunth"). Markdown-sensitive characters in both parts are backslash-escaped to keep the output well-formed. Printed via cat() and returned invisibly.

Details

Results are cached in memory per lower-cased, whitespace-normalised species string, shared by both functions, so repeat lookups skip the HTTP call.

Failures never raise an error: network/HTTP errors, timeouts, malformed JSON, no match, or a missing httr2 dependency all fall back to species verbatim with no authorship -- the same output produced for a name that resolved but has no authorship of its own. stop() is only reached for a structurally invalid species.

Examples

Run this code
if (FALSE) {
pacha_sc_full_name("Bidens andicola")
pacha_sc_full_name_md("Bidens andicola")
}

Run the code above in your browser using DataLab