R/cite.R

Defines functions cds_cite_dataset

Documented in cds_cite_dataset

#' Cite a dataset
#' 
#' Use this function to obtain citation details for a specific dataset
#' @param dataset The name of a dataset to be cited.
#' @param ... Ignored
#' @returns Returns a `BibEntry`-class object, with citation details for the requested
#' dataset
#' @examples
#' if (interactive()) {
#'   cds_cite_dataset("reanalysis-era5-pressure-levels")
#' }
#' @export
cds_cite_dataset <- function(dataset, ...) {
  if (requireNamespace("RefManageR")) {
    ds <- cds_list_datasets(dataset)
    RefManageR::GetBibEntryWithDOI(ds$`sci:doi`)
  } else {
    rlang::abort(c(x = "This function needs package RefManageR",
                   i = "Please install and try again"))
  }
}

Try the CopernicusClimate package in your browser

Any scripts or data that you put into this service are public.

CopernicusClimate documentation built on Jan. 8, 2026, 1:08 a.m.