# The version and year follow the installed package (from DESCRIPTION). The package was first released in 2018.
first <- "2018"
ver  <- if (!is.null(meta$Version)) meta$Version else utils::packageVersion("bayesammi")
date <- if (!is.null(meta$Date)) meta$Date else if (!is.null(meta$`Date/Publication`)) meta$`Date/Publication` else
  as.character(Sys.Date())
year <- substr(date, 1L, 4L)
note <- if (first == year) sprintf("R package version %s", ver) else
  sprintf("R package version %s (first released %s)", ver, first)
ttl  <- "bayesammi: Bayesian Estimation of the Additive Main Effects and Multiplicative Interaction Model"
auth <- c(
    person("Muhammad", "Yaseen", email = "myaseen208@gmail.com", comment = c(ORCID = "0000-0002-5923-1714"))
  , person("Jose", "Crossa")
  , person("Sergio", "Perez-Elizalde")
  , person("Diego", "Jarquin")
  , person(c("Jose", "Miguel"), "Cotes")
  , person("Kert", "Viele")
  , person("Genzhou", "Liu")
  , person(c("Paul", "L."), "Cornelius")
  , person(c("Julian", "Garcia"), "Abadillo Velasco")
  )
bibentry(
    bibtype     = "Manual"
  , key         = "bayesammi"
  , header      = "To cite bayesammi in publications use:"
  , title       = "{bayesammi}: Bayesian Estimation of the Additive Main Effects and Multiplicative Interaction Model"
  , author      = auth
  , year        = year
  , note        = note
  , url         = "https://CRAN.R-project.org/package=bayesammi"
  , textVersion = sprintf(paste("Yaseen, M., Crossa, J., Perez-Elizalde, S., Jarquin, D., Cotes, J. M., Viele, K.,",
                                "Liu, G., Cornelius, P. L. and Garcia Abadillo Velasco, J. (%s). %s. %s.",
                                "https://CRAN.R-project.org/package=bayesammi"), year, ttl, note)
  )
bibentry(
    bibtype     = "Article"
  , key         = "Crossa2011"
  , header      = "and for the methods (bam_cite() gives the references of a single analysis):"
  , title       = "Bayesian Estimation of the Additive Main Effects and Multiplicative Interaction Model"
  , author      = c(person(c("Jose"), "Crossa"),
                  person(c("Sergio"), "Perez-Elizalde"),
                  person(c("Diego"), "Jarquin"),
                  person(c("Jose", "Miguel"), "Cotes"),
                  person(c("Kert"), "Viele"),
                  person(c("Genzhou"), "Liu"),
                  person(c("Paul", "L."), "Cornelius"))
  , journal     = "Crop Science"
  , year        = "2011"
  , volume      = "51"
  , number      = "4"
  , pages       = "1458--1469"
  , doi         = "10.2135/cropsci2010.06.0343"
  , textVersion = paste("Crossa, J., Perez-Elizalde, S., Jarquin, D., Cotes, J. M., Viele, K., Liu, G. and",
                      "Cornelius, P. L. (2011). Bayesian estimation of the additive main effects and",
                      "multiplicative interaction model. Crop Science, 51(4), 1458-1469.",
                      "doi:10.2135/cropsci2010.06.0343")
  )
bibentry(
    bibtype     = "Article"
  , key         = "PerezElizalde2012"
  , title       = paste("A General {Bayesian} Estimation Method of Linear-Bilinear Models Applied to Plant",
                      "Breeding Trials with Genotype x Environment Interaction")
  , author      = c(person(c("Sergio"), "Perez-Elizalde"),
                  person(c("Diego"), "Jarquin"),
                  person(c("Jose"), "Crossa"))
  , journal     = "Journal of Agricultural, Biological, and Environmental Statistics"
  , year        = "2012"
  , volume      = "17"
  , number      = "1"
  , pages       = "15--37"
  , doi         = "10.1007/s13253-011-0063-9"
  , textVersion = paste("Perez-Elizalde, S., Jarquin, D. and Crossa, J. (2012). A general Bayesian estimation",
                      "method of linear-bilinear models applied to plant breeding trials with genotype x",
                      "environment interaction. Journal of Agricultural, Biological, and Environmental",
                      "Statistics, 17(1), 15-37. doi:10.1007/s13253-011-0063-9")
  )
bibentry(
    bibtype     = "Article"
  , key         = "Dias2022"
  , title       = "Leveraging Probability Concepts for Cultivar Recommendation in Multi-Environment Trials"
  , author      = c(person(c("K.", "O.", "G."), "Dias"),
                  person(c("J.", "P.", "R."), "dos Santos"),
                  person(c("M.", "D."), "Krause"),
                  person(c("H.-P."), "Piepho"),
                  person(c("L.", "J.", "M."), "Guimaraes"),
                  person(c("M.", "M."), "Pastina"),
                  person(c("A.", "A.", "F."), "Garcia"))
  , journal     = "Theoretical and Applied Genetics"
  , year        = "2022"
  , doi         = "10.1007/s00122-022-04041-y"
  , textVersion = paste("Dias, K. O. G., dos Santos, J. P. R., Krause, M. D., Piepho, H.-P., Guimaraes, L. J. M.,",
                      "Pastina, M. M. and Garcia, A. A. F. (2022). Leveraging probability concepts for cultivar",
                      "recommendation in multi-environment trials. Theoretical and Applied Genetics.",
                      "doi:10.1007/s00122-022-04041-y")
  )
bibentry(
    bibtype     = "Article"
  , key         = "FinlayWilkinson1963"
  , title       = "The Analysis of Adaptation in a Plant-Breeding Programme"
  , author      = c(person(c("K.", "W."), "Finlay"),
                  person(c("G.", "N."), "Wilkinson"))
  , journal     = "Australian Journal of Agricultural Research"
  , year        = "1963"
  , volume      = "14"
  , number      = "6"
  , pages       = "742--754"
  , doi         = "10.1071/AR9630742"
  , textVersion = paste("Finlay, K. W. and Wilkinson, G. N. (1963). The analysis of adaptation in a plant-breeding",
                      "programme. Australian Journal of Agricultural Research, 14(6), 742-754.",
                      "doi:10.1071/AR9630742")
  )
bibentry(
    bibtype     = "Article"
  , key         = "EberhartRussell1966"
  , title       = "Stability Parameters for Comparing Varieties"
  , author      = c(person(c("S.", "A."), "Eberhart"),
                  person(c("W.", "A."), "Russell"))
  , journal     = "Crop Science"
  , year        = "1966"
  , volume      = "6"
  , number      = "1"
  , pages       = "36--40"
  , doi         = "10.2135/cropsci1966.0011183X000600010011x"
  , textVersion = paste("Eberhart, S. A. and Russell, W. A. (1966). Stability parameters for comparing varieties.",
                      "Crop Science, 6(1), 36-40. doi:10.2135/cropsci1966.0011183X000600010011x")
  )
bibentry(
    bibtype     = "Article"
  , key         = "Shukla1972"
  , title       = "Some Statistical Aspects of Partitioning Genotype-Environmental Components of Variability"
  , author      = c(person(c("G.", "K."), "Shukla"))
  , journal     = "Heredity"
  , year        = "1972"
  , volume      = "29"
  , number      = "2"
  , pages       = "237--245"
  , doi         = "10.1038/hdy.1972.87"
  , textVersion = paste("Shukla, G. K. (1972). Some statistical aspects of partitioning genotype-environmental",
                      "components of variability. Heredity, 29(2), 237-245. doi:10.1038/hdy.1972.87")
  )
bibentry(
    bibtype     = "Article"
  , key         = "LianCampos2016"
  , title       = paste("{FW}: An {R} Package for {Finlay-Wilkinson} Regression that Incorporates Genomic/Pedigree",
                      "Information and Covariance Structures Between Environments")
  , author      = c(person(c("L."), "Lian"),
                  person(c("G."), "de los Campos"))
  , journal     = "G3: Genes, Genomes, Genetics"
  , year        = "2016"
  , volume      = "6"
  , number      = "3"
  , pages       = "589--597"
  , doi         = "10.1534/g3.115.026328"
  , textVersion = paste("Lian, L. and de los Campos, G. (2016). FW: an R package for Finlay-Wilkinson regression",
                      "that incorporates genomic/pedigree information and covariance structures between",
                      "environments. G3: Genes, Genomes, Genetics, 6(3), 589-597. doi:10.1534/g3.115.026328")
  )
bibentry(
    bibtype     = "Article"
  , key         = "Oliveira2018"
  , title       = paste("The {Eberhart} and {Russell}'s {Bayesian} Method Used as an Instrument to Select Maize",
                      "Hybrids")
  , author      = c(person(c("T.", "R.", "A."), "de Oliveira"),
                  person(c("H.", "W.", "L."), "de Carvalho"),
                  person(c("M."), "Nascimento"),
                  person(c("E.", "F.", "N."), "Costa"),
                  person(c("A.", "T."), "do Amaral Junior"),
                  person(c("G.", "A."), "Gravina"),
                  person(c("J.", "L.", "S."), "de Carvalho Filho"))
  , journal     = "Euphytica"
  , year        = "2018"
  , volume      = "214"
  , pages       = "64"
  , doi         = "10.1007/s10681-018-2146-y"
  , textVersion = paste("Oliveira, T. R. A., Carvalho, H. W. L., Nascimento, M., Costa, E. F. N., Amaral Junior,",
                      "A. T., Gravina, G. A. and Carvalho Filho, J. L. S. (2018). The Eberhart and Russell's",
                      "Bayesian method used as an instrument to select maize hybrids. Euphytica, 214, 64.",
                      "doi:10.1007/s10681-018-2146-y")
  )
bibentry(
    bibtype     = "Article"
  , key         = "EdwardsJannink2006"
  , title       = paste("{Bayesian} Modeling of Heterogeneous Error and Genotype x Environment Interaction",
                      "Variances")
  , author      = c(person(c("J.", "W."), "Edwards"),
                  person(c("J.-L."), "Jannink"))
  , journal     = "Crop Science"
  , year        = "2006"
  , volume      = "46"
  , number      = "2"
  , pages       = "820"
  , doi         = "10.2135/cropsci2005.0164"
  , textVersion = paste("Edwards, J. W. and Jannink, J.-L. (2006). Bayesian modeling of heterogeneous error and",
                      "genotype x environment interaction variances. Crop Science, 46(2), 820.",
                      "doi:10.2135/cropsci2005.0164")
  )
bibentry(
    bibtype     = "Article"
  , key         = "Eskridge1990"
  , title       = "Selection of Stable Cultivars Using a Safety-First Rule"
  , author      = c(person(c("K.", "M."), "Eskridge"))
  , journal     = "Crop Science"
  , year        = "1990"
  , volume      = "30"
  , pages       = "369--374"
  , textVersion = paste("Eskridge, K. M. (1990). Selection of stable cultivars using a safety-first rule. Crop",
                      "Science, 30, 369-374.")
  )
bibentry(
    bibtype     = "Article"
  , key         = "Wricke1962"
  , title       = "{\\\"U}ber eine Methode zur Erfassung der {\\\"o}kologischen Streubreite in Feldversuchen"
  , author      = c(person(c("G."), "Wricke"))
  , journal     = "Zeitschrift f{\\\"u}r Pflanzenz{\\\"u}chtung"
  , year        = "1962"
  , volume      = "47"
  , pages       = "92--96"
  , textVersion = paste("Wricke, G. (1962). Uber eine Methode zur Erfassung der okologischen Streubreite in",
                      "Feldversuchen. Zeitschrift fur Pflanzenzuchtung, 47, 92-96.")
  )
bibentry(
    bibtype     = "Article"
  , key         = "LinBinns1988"
  , title       = "A Superiority Measure of Cultivar Performance for Cultivar x Location Data"
  , author      = c(person(c("C.", "S."), "Lin"),
                  person(c("M.", "R."), "Binns"))
  , journal     = "Canadian Journal of Plant Science"
  , year        = "1988"
  , volume      = "68"
  , number      = "1"
  , pages       = "193--198"
  , doi         = "10.4141/cjps88-018"
  , textVersion = paste("Lin, C. S. and Binns, M. R. (1988). A superiority measure of cultivar performance for",
                      "cultivar x location data. Canadian Journal of Plant Science, 68(1), 193-198.",
                      "doi:10.4141/cjps88-018")
  )
bibentry(
    bibtype     = "Article"
  , key         = "Annicchiarico1992"
  , title       = "Cultivar Adaptation and Recommendation from Alfalfa Trials in {Northern Italy}"
  , author      = c(person(c("P."), "Annicchiarico"))
  , journal     = "Journal of Genetics and Breeding"
  , year        = "1992"
  , volume      = "46"
  , pages       = "269--278"
  , textVersion = paste("Annicchiarico, P. (1992). Cultivar adaptation and recommendation from alfalfa trials in",
                      "Northern Italy. Journal of Genetics and Breeding, 46, 269-278.")
  )
bibentry(
    bibtype     = "Article"
  , key         = "Purchase2000"
  , title       = paste("Genotype x Environment Interaction of Winter Wheat ({Triticum aestivum} {L}.) in South",
                      "Africa: {II}. Stability Analysis of Yield Performance")
  , author      = c(person(c("J.", "L."), "Purchase"),
                  person(c("H."), "Hatting"),
                  person(c("C.", "S."), "van Deventer"))
  , journal     = "South African Journal of Plant and Soil"
  , year        = "2000"
  , volume      = "17"
  , number      = "3"
  , pages       = "101--107"
  , textVersion = paste("Purchase, J. L., Hatting, H. and van Deventer, C. S. (2000). Genotype x environment",
                      "interaction of winter wheat (Triticum aestivum L.) in South Africa: II. Stability",
                      "analysis of yield performance. South African Journal of Plant and Soil, 17(3), 101-107.")
  )
bibentry(
    bibtype     = "Article"
  , key         = "Sneller1997"
  , title       = "Repeatability of Yield Stability Statistics in Soybean"
  , author      = c(person(c("C.", "H."), "Sneller"),
                  person(c("L."), "Kilgore-Norquest"),
                  person(c("D."), "Dombek"))
  , journal     = "Crop Science"
  , year        = "1997"
  , volume      = "37"
  , number      = "2"
  , pages       = "383--390"
  , textVersion = paste("Sneller, C. H., Kilgore-Norquest, L. and Dombek, D. (1997). Repeatability of yield",
                      "stability statistics in soybean. Crop Science, 37(2), 383-390.")
  )
bibentry(
    bibtype     = "InProceedings"
  , key         = "Zobel1994"
  , title       = "Stress Resistance and Root Systems"
  , author      = c(person(c("R.", "W."), "Zobel"))
  , booktitle   = "Proceedings of the Workshop on Adaptation of Plants to Soil Stress"
  , series      = "INTSORMIL Publication 94-2"
  , year        = "1994"
  , pages       = "80--99"
  , publisher   = "Institute of Agriculture and Natural Resources, University of Nebraska-Lincoln"
  , textVersion = paste("Zobel, R. W. (1994). Stress resistance and root systems. In Proceedings of the Workshop",
                      "on Adaptation of Plants to Soil Stress, INTSORMIL Publication 94-2, 80-99. Institute of",
                      "Agriculture and Natural Resources, University of Nebraska-Lincoln.")
  )
bibentry(
    bibtype     = "Article"
  , key         = "Zali2012"
  , title       = paste("Evaluation of Genotype x Environment Interaction in Chickpea Using Measures of Stability",
                      "from {AMMI} Model")
  , author      = c(person(c("H."), "Zali"),
                  person(c("E."), "Farshadfar"),
                  person(c("S.", "H."), "Sabaghpour"),
                  person(c("R."), "Karimizadeh"))
  , journal     = "Annals of Biological Research"
  , year        = "2012"
  , volume      = "3"
  , number      = "7"
  , pages       = "3126--3136"
  , textVersion = paste("Zali, H., Farshadfar, E., Sabaghpour, S. H. and Karimizadeh, R. (2012). Evaluation of",
                      "genotype x environment interaction in chickpea using measures of stability from AMMI",
                      "model. Annals of Biological Research, 3(7), 3126-3136.")
  )
bibentry(
    bibtype     = "Article"
  , key         = "Olivoto2019"
  , title       = paste("Mean Performance and Stability in Multi-Environment Trials {I}: Combining Features of",
                      "{AMMI} and {BLUP} Techniques")
  , author      = c(person(c("T."), "Olivoto"),
                  person(c("A.", "D.", "C."), "Lucio"),
                  person(c("J.", "A.", "G."), "da Silva"),
                  person(c("V.", "S."), "Marchioro"),
                  person(c("V.", "Q."), "de Souza"),
                  person(c("E."), "Jost"))
  , journal     = "Agronomy Journal"
  , year        = "2019"
  , volume      = "111"
  , number      = "6"
  , pages       = "2949--2960"
  , doi         = "10.2134/agronj2019.03.0220"
  , textVersion = paste("Olivoto, T., Lucio, A. D. C., da Silva, J. A. G., Marchioro, V. S., de Souza, V. Q. and",
                      "Jost, E. (2019). Mean performance and stability in multi-environment trials I: combining",
                      "features of AMMI and BLUP techniques. Agronomy Journal, 111(6), 2949-2960.",
                      "doi:10.2134/agronj2019.03.0220")
  )
