cboettig / knitcitations

:package: Generate citations for knitr markdown and html files
http://carlboettiger.info
Other
220 stars 28 forks source link

citep() and caching chunks #93

Closed lfaller closed 8 years ago

lfaller commented 8 years ago

Hi all,

I usually set my global chunks in the beginning of the Rmarkdown document as follows:

knitr::opts_chunk$set(fig.width=12, fig.height=8, echo=FALSE, warning=FALSE, message=FALSE, cache=TRUE, results = 'hide')

I noticed that I sometimes get an error message for citep() when I try to compile a PDF document:

Error in eval(expr, envir, enclos) : could not find function "citep" Calls: <Anonymous> ... in_dir -> inline_exec -> withVisible -> eval -> eval Execution halted

I double-checked and I definitely call library("knitcitations") before I call citep().

This error seems to go away when I manually delete the folder with cached files.

Is this a coincidence, or does knitcitations not play well with cached files?

Thanks for any advice you might have!

Best, ~Lina

cboettig commented 8 years ago

I believe knitr advice is not to ever cache your library calls

lfaller commented 8 years ago

An easy fix -- thanks!!