Include code that does not run in Rpresentation Markdown
{r, eval=F, echo=T}
will include the R source code in the output file while it is not evaluated
Have you tried eval=FALSE
in the knitr
code chunk options? e.g.:
```{r eval=FALSE}
print("Don't run me")
```