cer_cite: Cite a cer_tbl or URL in BibTeX, plain-text, or APA form

View source: R/cite.R

cer_citeR Documentation

Cite a cer_tbl or URL in BibTeX, plain-text, or APA form

Description

Returns a citation suitable for footnotes, papers, and carbon market analysis reports. Uses the provenance attributes attached to every cer_tbl: source URL, licence, retrieval date, title, snapshot pin (from cer_snapshot()), and SHA-256 digest.

Usage

cer_cite(x, style = c("text", "bibtex", "apa"), doi = NULL)

Arguments

x

A cer_tbl (as returned by any ⁠cer_*⁠ data function) or a character URL.

style

One of "text" (default), "bibtex", or "apa".

doi

Optional DOI (e.g. from cer_deposit_zenodo()) to include in BibTeX output as a doi field and APA suffix.

Details

For carbon market research, the BibTeX note field includes the snapshot date and first 12 hex characters of the SHA-256, which are the minimum provenance fields needed to defend a published figure against a reviewer.

Value

A character string.

See Also

Other reproducibility: cer_deposit_zenodo(), cer_legislative_instrument(), cer_manifest(), cer_manifest_clear(), cer_manifest_write(), cer_sha256(), cer_snapshot()

Examples

x <- data.frame(a = 1)
x <- structure(x,
  cer_source = "https://cer.gov.au/markets/reports-and-data/accu-project-and-contract-register",
  cer_licence = "CC BY 4.0",
  cer_retrieved = as.POSIXct("2026-04-24 00:00:00", tz = "UTC"),
  cer_title = "ACCU project register",
  cer_sha256 = "abc123def456",
  cer_snapshot_date = "2026-04-24",
  class = c("cer_tbl", "data.frame"))
cer_cite(x)
cer_cite(x, style = "bibtex")
# DOI style: supply any minted DOI (Zenodo, DataCite, etc.).
# The placeholder below is illustrative only.
cer_cite(x, style = "apa", doi = "10.5281/zenodo.XXXXXXXX")

cer documentation built on Dec. 3, 2026, 1:06 a.m.