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

When I write code in an Rmd file

```{r} '+'(3,5) ``` 

knitr returns html file as

 3 + 5 

Thus, it converts the expression to a more general format. How can I turn off such a conversion to keep the expression as it is? For comparison, the same code in the Rpres file displays correctly '+'(3,5) .

+7
r knitr
source share
1 answer

All credits go to @rawr and his comment is "set tidy = FALSE ".

This question should have been answered.

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

produces enter image description here

+2
source share

All Articles