eval.after documentation

12 views
Skip to first unread message

Oleg Mayba

unread,
Apr 26, 2016, 1:57:28 AM4/26/16
to knitr
It looks like eval.after does not work for chunk options like 'eval' and 'echo' the way it does for fig.cap (and I honestly did not expect it to):

<<setupChunk, echo=TRUE, eval=TRUE>>=
opts_knit$set(eval.after='echo')
@


<<furtherChunk, echo=x>>=
opts_chunk$get('echo')
x <- FALSE
i <- 3
i
@

This displays the code in the 'furtherChunk' and shows that echo is TRUE. Omitting the setup chunk, leads to an error ('x not found'), as expected.

My question is: is it possible to list on the eval.after documentation page the chunk options for which one should not expect eval.after to work properly?

Thanks!

Oleg.

Yihui Xie

unread,
Apr 26, 2016, 2:16:49 AM4/26/16
to Oleg Mayba, knitr
Ideally yes, I should document which chunk options should not be
evaluated after a chunk, but I don't have the time at the moment, and
it is not a feature that is very frequently used, so it will probably
remain undocumented for a while... If you want to figure out the
accurate list of options, you may see which chunk options have been
used up to this line:
https://github.com/yihui/knitr/blob/9923c6735852c887629f1d2622eeb7abd9224713/R/block.R#L188

Regards,
Yihui
--
Yihui Xie <xiey...@gmail.com>
Web: http://yihui.name

Oleg Mayba

unread,
May 3, 2016, 1:24:36 AM5/3/16
to knitr, oleg....@gmail.com
I think the following is the full list:

engine, cache, engine.opts, include, fig.keep, fig.width, fig.height, dev, dev.args, dpi, fig.showtext, code, echo, tidy.opts, label, eval, tidy, fig.ext, error, hash, cache.lazy, cache.rebuild, warning, message, render

8-)
Reply all
Reply to author
Forward
0 new messages