## R package reference generated from DESCRIPTION metadata
citation(auto = meta)

if(FALSE) {

PKG <- "simest"

citHeader(paste("To cite the R package ",PKG," in publications use:"))

meta <- packageDescription(PKG)
stopifnot(meta$Package == PKG)
authR <- eval(parse(text = meta$`Authors@R`, keep.source = FALSE))
## and keep only "aut" and "cre" (but not "ctb" etc) authors:
authR <- authR[vapply(authR$role, \(rls) any(rls %in% c("aut","cre")), NA)]
year <- sub("-.*", "", meta$Date)
note <- sprintf("R package version %s", meta$Version)
url <- paste0("https://CRAN.R-project.org/package=", PKG)

bibe <-  # for debugging
bibentry(bibtype = "Manual",
  title        = sprintf("{%s}: %s", PKG,  meta$Title),
  author       = authR,
  year         = year,
  note         = note,
  url          = url,
  textVersion  =
      paste(c(toBibtex(authR)),
            sprintf("(%s).", year),
            sprintf("%s: %s", PKG, meta$Title),
            note, "URL", url))

}
