Display functions like '+' or '[' as is

knitr, r

Solution

All the credit goes to @rawr, and his comment of "set `tidy = FALSE`".

This question needed an answer.

{r, tidy=FALSE} '+'(3, 5)

`

produces

Problem

When I write code chunk in Rmd-file ```` ```{r} '+'(3,5) ``` ```` `knitr` returns html-file as ``` 3 + 5 ``` So it transforms the expression to more common format. How can I disable such transformation to keep expression as is? In comparison, the same code in Rpres-file is displayed correctly `'+'(3,5)`.

Original source