year <- sub("-.*", "", meta$Date)
version_note <- paste("R package version", meta$Version)
pkg <- meta$Package
title <- gsub("'", "", meta$Title)
doi <- paste0("10.32614/CRAN.package.", pkg)

bibentry("Article",
  header = "Kindly cite this package by citing the following R Journal article:",
  key = "10.32614/RJ-2017-019",
  title = "Retrieval and Analysis of Eurostat Open Data with the eurostat Package",
  author = c(
    person("Leo", "Lahti"), 
    person("Janne", "Huovari"),
    person("Markus", "Kainu"), 
    person("Przemyslaw", "Biecek")
  ),
  journal = "The R Journal",
  volume = 9,
  number = 1,
  pages = "385--392",
  year = "2017",
  doi = "10.32614/RJ-2017-019",
  url = "https://doi.org/10.32614/RJ-2017-019",
  textVersion =
    paste("Lahti L., Huovari J., Kainu M., and Biecek P. (2017).",
      "Retrieval and analysis of Eurostat open data with the eurostat package. The R Journal 9(1), pp. 385-392.",
      "doi: 10.32614/RJ-2017-019",
      sep = " "
    )
)

bibentry(bibtype = "Misc",
  header = "In addition, please provide a citation to the specific software version used:",
  key = paste0("R-", pkg),
  title = "eurostat: Tools for Eurostat Open Data",
  doi = doi,
  author = c(
    person("Leo", "Lahti"),
    person("Janne", "Huovari"),
    person("Markus", "Kainu"),
    person("Przemyslaw", "Biecek"),
    person("Diego", "Hernangomez"),
    person("Daniel", "Antal"),
    person("Pyry", "Kantanen")
  ),
  url = "https://github.com/rOpenGov/eurostat",
  type = "Computer software",
  year = year,
  note = version_note
)
