if (!exists("meta") || is.null(meta)) meta <- packageDescription("vayr")

bibentry(
  bibtype = "InCollection",
  header = "To cite the principles that 'vayr' implements:",
  title = "Visualize As You Randomize: Design-based Statistical Graphs for Randomized Experiments",
  author = person("Alexander", "Coppock"),
  booktitle = "Advances in Experimental Political Science",
  editor = c(person("James N.", "Druckman"), person("Donald P.", "Green")),
  publisher = "Cambridge University Press",
  address = "New York",
  year = "2021",
  pages = "320--336",
  doi = "10.1017/9781108777919.022"
)

bibentry(
  key = "vayr",
  bibtype = "Manual",
  header = "To cite the package itself:",
  title = paste0("vayr: ", meta$Title),
  author = person("Alexander", "Coppock"),
  year = "2026",
  note = paste("R package version", meta$Version),
  url = "https://alexandercoppock.com/vayr/"
)
