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

citHeader("To cite package", sQuote(meta$Package), "in publications, please cite the Doser, Finley, Kéry, Zipkin (2022) paper. If using functions lfJSDM, sfJSDM, lfMsPGOcc, or sfMsPGOcc, please also cite the Doser, Finley, Banerjee (2022) paper that introduces this functionality:")

year <- sub(".*(2[[:digit:]]{3})-.*", "\\1", meta$Date, perl = TRUE)
vers <- paste("R package version", meta$Version)

bibentry(bibtype = "Article",
  title        = "{spOccupancy}: An R package for single-species, multi-species, and integrated spatial occupancy models",
  author       = c(as.person("Jeffrey W. Doser"), as.person("Andrew O. Finley"), as.person("Marc Kéry"), as.person("Elise F. Zipkin")),
  journal      = "Methods in Ecology and Evolution",
  year         = "2022",
  volume       = "",
  number       = "",
  pages        = "",
  url          = "https://doi.org/10.1111/2041-210X.13897",

  textVersion  =
  paste("Doser, J. W., Finley A. O., Kéry, M., & Zipkin E. F. (2022).",
        "spOccupancy: An R package for single-species, multi-species, and integrated spatial occupancy models",
        "Methods in Ecology and Evolution. https://doi.org/10.1111/2041-210X.13897")
)

citHeader("")

bibentry(bibtype = "Article",
  title        = "Joint species distribution models with imperfect detection for high-dimensional spatial data",
  author       = c(as.person("Jeffrey W. Doser"), as.person("Andrew O. Finley"), as.person("Sudipto Banerjee")),
  journal      = "arXiv preprint arXiv:2204.02707",
  year         = "2022",
  volume       = "",
  number       = "",
  pages        = "",
  url          = "https://arxiv.org/abs/2204.02707",

  textVersion  =
  paste("Doser, J. W., Finley A. O., & Banerjee, S. (2022).",
        "Joint species distribution models with imperfect detection for high-dimensional spatial data",
        "arXiv preprint arXiv:2204.02707")
)
