Search code examples
rmarkdownpresentation

Include code that does not run in Rpresentation Markdown


I have a .Rpres file in RStudio. I would like to include code, but not have it run (I am only showing the code to explain how it works). Is it possible to accomplish this (and ensure that it will not produce errors, because it is not running)?


Solution

  • Have you tried eval=FALSE in the knitr code chunk options? For example:

    ```{r, eval=FALSE}
    print("Don't run me")
    ```