ggplot2-transition-guide icon indicating copy to clipboard operation
ggplot2-transition-guide copied to clipboard

a few knitr issues

Open yihui opened this issue 13 years ago • 2 comments

  • the setup chunk must not be cached (should use cache=FALSE)
  • I see most chunks are cached, so I suggest set it as a global option \SweaveOpts{cache=TRUE} so you do not have to set it in every single chunk (only need to set cache=FALSE for those you do not want to cache); the same issue applies to message=FALSE
  • echo=TRUE is by default, so no need to set it explicitly

yihui avatar Jan 27 '12 02:01 yihui

Thank you for the corrections, Yihui.

Does Sweave have to be loaded as a LaTeX package for \SweaveOpts{} to be read? I noticed in the code to the knitr manuals that the \SweaveOpts{} line was commented out, so I'm curious as to what happens if Sweave is loaded as a LaTeX package but the document is run in R with knit() rather than Sweave().

Dennis


From: Yihui Xie [email protected] To: Dennis Murphy [email protected] Sent: Thursday, January 26, 2012 6:36 PM Subject: [ggplot2-transition-guide] a few knitr issues (#1)

  • the setup chunk must not be cached (should use cache=FALSE)
  • I see most chunks are cached, so I suggest set it as a global option \SweaveOpts{cache=TRUE} so you do not have to set it in every single chunk (only need to set cache=FALSE for those you do not want to cache); the same issue applies to message=FALSE
  • echo=TRUE is by default, so no need to set it explicitly

Reply to this email directly or view it on GitHub: https://github.com/djmurphy420/ggplot2-transition-guide/issues/1

djmurphy420 avatar Jan 27 '12 08:01 djmurphy420

No, sweave is not needed. It is just a matter of syntax. And it does not matter where is \SweaveOpts{}; it can appear after %. I wrote it there because I want to make the document as LaTeX-ish as possible (\SweaveOpts{} itself is not a valid LaTeX command).

yihui avatar Jan 27 '12 16:01 yihui