


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 <- meta$Title

#*** list of authors
person_list1 <- c(
                   person(given = "Alexander", family = "Robitzsch")
                      )

person_list2 <- "Robitzsch, A."


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

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

bibentry(key = paste0(tolower(pkg), "_", vers), 
         bibtype = "Manual",
         title = paste0( pkg , ": " , pkg_title ) ,
         author = c( 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) )
)



