citHeader("To cite the 'openVA' package in publications, please use:")

year = sub('.*(2[[:digit:]]{3})-.*', '\\1', meta$Date, perl = TRUE)
if (length(year) == 0) year = format(Sys.Date(), '%Y')
vers = paste('R package version', meta$Version)
auth = c("Zehang Richard Li, Jason Thomas, Tyler H. McCormick, and Samuel J. Clark")


bibentry(
  bibtype = 'article',
  title = 'The openVA Toolkit for Verbal Autopsies',
  author = c('Zehang Richard Li', 'Jason Thomas', 'Eungang Choi', 'Tyler H. McCormick', 'Samuel J. Clark '),
  journal = 'the R Journal',
  year = '2023',
  url = 'https://journal.r-project.org/articles/RJ-2023-020/',
  textVersion = paste(
    'Zehang Richard Li, Jason Thomas, Eungang Choi, Tyler H. McCormick, and Samuel J Clark (2023).',
    'The openVA Toolkit for Verbal Autopsies.', 'The R Journal',
    'URL https://journal.r-project.org/articles/RJ-2023-020/.'
  )
)

bibentry(
  bibtype = 'manual',
  title = paste('openVA:', meta$Title),
  author = auth,
  year = year,
  note = vers,
  url = strsplit(meta$URL, ',')[[1]][1],
  textVersion = paste0(
    paste(auth, collapse = ' and '), ' (', year, '). openVA: ', meta$Title, '. ', vers, '.',
    ' URL https://cran.r-project.org/web/packages/openVA/index.html.'
  )
)
