## Citation information for the AMCP package.
## citation("AMCP") returns the book first (the primary citation) and
## the data package itself second.

citHeader(
  "The AMCP package provides the data sets that accompany Maxwell, ",
  "Delaney, and Kelley's textbook. Please cite the BOOK as the primary ",
  "reference; you may additionally cite the package if you wish to ",
  "credit the specific data distribution you used."
)

## ---- Primary citation: the book -------------------------------------
bibentry(
  bibtype   = "Book",
  key       = "MaxwellDelaneyKelley2027",
  title     = "Designing Experiments and Analyzing Data: A Model Comparison Perspective",
  author    = c(person("Scott E.", "Maxwell"),
                person("Harold D.", "Delaney"),
                person("Ken", "Kelley")),
  year      = "2027",
  edition   = "4th",
  publisher = "Routledge",
  address   = "New York, NY",
  isbn      = "978-1-041-25384-6",
  url       = "https://www.routledge.com/Designing-Experiments-and-Analyzing-Data-A-Model-Comparison-Perspective/Maxwell-Delaney-Kelley/p/book/9781041253846",
  textVersion = paste0(
    "Maxwell, S. E., Delaney, H. D., & Kelley, K. (2027). ",
    "Designing experiments and analyzing data: A model comparison ",
    "perspective (4th ed.). New York, NY: Routledge."
  )
)

## ---- Secondary citation: the data package ---------------------------
local({
  year <- sub("-.*", "", meta$Date)
  if (length(year) == 0L || is.na(year) || !nzchar(year))
    year <- format(Sys.Date(), "%Y")
  vers <- meta$Version
  if (is.null(vers)) vers <- "2.0.0"

  bibentry(
    bibtype = "Manual",
    key     = "AMCPpackage",
    title   = "AMCP: A Model Comparison Perspective (Data Sets for the 4th Edition)",
    author  = c(person("Scott E.", "Maxwell"),
                person("Harold D.", "Delaney"),
                person("Ken", "Kelley")),
    year    = year,
    note    = paste0("R package version ", vers),
    url     = "https://CRAN.R-project.org/package=AMCP",
    textVersion = paste0(
      "Maxwell, S. E., Delaney, H. D., & Kelley, K. (", year, "). ",
      "AMCP: A model comparison perspective (data sets for the 4th edition). ",
      "R package version ", vers, ". ",
      "https://CRAN.R-project.org/package=AMCP"
    )
  )
})
