Packrat generates a lock file with all the packages actually used in a repository (including dependencies). I thought it'd be nice to use this lock file to generate my citations for the project website.
The lockfile has this format.
PackratFormat: 1.4
PackratVersion: 0.4.8.1
RVersion: 3.3.0
Repos: CRAN=https://cran.rstudio.com/
Package: BH
Source: CRAN
Version: 1.62.0-1
Hash: 14dfb3e8ffe20996118306ff4de1fab2
Package: DT
Source: CRAN
Version: 0.2
Hash: 36b032203797956fedad5a25055016a9
Requires: htmltools, htmlwidgets, magrittr
Etc. I'd like to end up with a bibtex file including citations to all packages + the R and the Packrat versions. Then I'd like to append this bibliography via Rmarkdown.
The first part can be done. I can kludge something with Regex matching, but I thought I should parse the file. There is an internal function in packrat that I will use for this, although internal is of course not optimal.
However, I'm unsure how to concatenate the citations afterwards and I also thought somebody might have done this before, hence this question. Simply concatenating them as a string might work, but they seem to lack identifiers and I need to mention them by an identifier in the markdown file..