Learn R Programming

pacha (version 0.1.1)

reference_pacha: Retrieve the source database citation

Description

Retrieves how the configured data source itself should be cited, as distinct from any per-species bibliographic reference. For the API source, this is the citation field of the configured ChecklistBank dataset (GET /dataset/{key}), resolved once and cached, since it does not vary by species. For the local source, this is the citation entry of metadata.yaml inside the configured ColDP archive. Either source may return the citation as CSL HTML (e.g. wrapped in <div class="csl-entry">, with <span style="font-style: italic"> and HTML entities); this function strips all markup and decodes entities, returning clean, unformatted text.

Usage

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

Value

A single character string with the plain-text source citation, or the localized no-data/connection message.

Arguments

species

Ignored. Accepted only so a positional call does not collide with language. Unlike the other accessors in this module, reference_pacha() does not return a species-specific citation: the citation identifies the configured dataset or archive as a whole, and is identical for every species queried against that source. Passing a non-NULL value here has no effect on the result and emits a warning.

language

Optional output-language code or alias used for the localized no-data/connection message.

source

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

refresh

Logical scalar. If TRUE, fetches the citation again instead of reusing its cached value.

Examples

Run this code
if (FALSE) {
reference_pacha()
reference_pacha(source = "coldp")
}

Run the code above in your browser using DataLab