

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

#*** package and its name
pkg_title <- "Some additional multiple imputation functions, especially for mice"

#*** list of authors
person_list1 <- c(
                   person(given = "Alexander",  family = "Robitzsch"),
                   person(given = "Simon", family = "Grund"),
	      person(given = "Thorsten",   family = "Henke") 
                      )
person_list2 <- "Robitzsch, A., Grund, S., & Henke, T."


#*******************************************
# automatic generation of citation key

citHeader( paste0( "To cite the '", pkg , "' package in publications use:") )

citEntry(entry="Manual",
         title = paste0( pkg , ": " , pkg_title ) ,
         author = personList( person_list1 ),
         year = year,
         note = vers,
         url =  paste0( "https://CRAN.R-project.org/package=", pkg) ,
         textVersion =
         paste0( person_list2 , " (",   year, "). " , 
               pkg , ": " , pkg_title , ". ",
               vers, paste0( ". https://CRAN.R-project.org/package=", pkg) )
    )

