Just replace \bibliography{R-Pckgs.bib}
with \bibliography{R-Pckgs}
, and it should work fine.
On Windows 7, with an up-to-date MikTeX installation and current R and R packages, the following worked:
- Put your reproducible example in a file named
"eg.Rnw"
and edit to remove the extraneous".bib"
- Launch R and navigate to the directory in which
"eg.Rnw"
is located. - Do
library(knitr); knit2pdf("eg.Rnw")
Note: There are obviously many workflows for going from *.Rnw
to *.pdf
, but if you want to use knit2pdf()
(at least), make sure that you run it from the directory containing the *.Rnw
to be processed.