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

citHeader("To cite use of 'analogue' in publications use:")

bibentry(bibtype="Manual",
	title ="analogue: Analogue and weighted averaging methods for palaeoecology",
	author = c(person(given = "Gavin L.", family = "Simpson",
                    comment = c(ORCID = "0000-0002-9084-8413")),
	           person(given = "Jari", family = "Oksanen")),
	year = sub(".*(2[[:digit:]]{3})-.*", "\\1", meta$Date),
	note = paste("R package version", meta$Version),
   url = "https://cran.r-project.org/package=analogue",

	textVersion =
	paste("Simpson, G.L. and Oksanen, J. ", paste("(", sub(".*(2[[:digit:]]{3})-.*", "\\1", meta$Date), ")."),
         "analogue: Analogue matching and Modern Analogue Technique transfer function models. (R package version",
	      meta$Version,").",
	      "(https://cran.r-project.org/package=analogue).", sep=" ")
)

bibentry(bibtype = "Article",
  title   = "Analogue Methods in Palaeoecology: Using the analogue Package",
  author  = person(given = "Gavin L.", family =  "Simpson"),
  journal = "Journal of Statistical Software",
  year    = "2007",
  volume  = "22",
  number  = "2",
  pages   = "1--29",

  textVersion =
    paste("Simpson, G.L. (2007).",
      "Analogue Methods in Palaeoecology: Using the analogue Package",
      "Journal of Statistical Software, 22(2), 1--29")
)
