Yihui gets the credit for this one. http://stackoverflow.com/questions/20409172/how-to-display-verbatim-inline-r-code-with-backticks-using-rmarkdown Writing text to give examples of inline r code is tricky. This function should achieve that.

nice_inline_r(x)

Arguments

x

A string of R code for printing as code, inline

Value

A formatted string

Examples

nice_inline_r("round(3.77155454, 3)")
#> [1] "``` `r round(3.77155454, 3)` ```"