## Citation Prep
pkgDesc = list (
  Version = "0.2.1.2",
  Package = "rENA",
  Title = "Epistemic Network Analysis",
  "Authors@R" = c(person("Cody L","Marquart", role = c("aut", "cre"), email="cody.marquart@wisc.edu"), person("Zachari","Swiecki", role = c("aut"), email="swiecki@wisc.edu"), person("Wesley","Collier", role = c("aut"), email="wcollier@wisc.edu"), person("Brendan","Eagan", role = c("aut"), email="beagan@wisc.edu"), person("Roman", "Woodward", role = c("aut"), email="rwoodward3@wisc.edu"),person("David Williamson", "Shaffer", role = c("aut"), email = "dws@education.wisc.edu"))
)

pkgLink = paste0("https://cran.rstudio.com/web/packages/", pkgDesc$Package, "/index.html")
#pkgPeople = eval(parse(text=pkgDesc$`Authors@R`))
pkgPeople = pkgDesc$`Authors@R`

authorPeople = sapply(pkgPeople, function(p) {
  paste(p$family, paste(paste0(abbreviate(strsplit(p$given, " ")[[1]], minlength = 1, dot = F, named = F), "."), collapse =  " "), sep = ", ")
})
authorStr = paste0(paste(authorPeople[1:length(authorPeople)-1], collapse = ", "), " & ", authorPeople[length(authorPeople)])

## Actual citation
citHeader(paste0("To cite ", pkgDesc$Package," in publications use:"))

citEntry(
  entry = "Manual",
  title        = paste0(pkgDesc$Package, ": ", pkgDesc$Title),
  author       = authorPeople,
  version      = pkgDesc$Version,

  textVersion  =
   paste0(authorStr, " (2018). ", pkgDesc$Package, ": ", pkgDesc$Title, " (", pkgDesc$Version, "). https://cran.rstudio.com/web/packages/", pkgDesc$Package, "/")
)
