Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to escape backticks in knitr?

Tags:

r

knitr

I have a variable named statistical value of life in millions of 2006 dollars, and I'm trying to include the value in inline knitr code.

`r `statistical value of life in millions of 2006 dollars` `

I can't figure out how to escape the backticks.

like image 223
bramtayl Avatar asked Sep 21 '15 14:09

bramtayl


People also ask

How do you escape the backticks?

As mentioned in the other answers to the question, you can simply escape backticks with a backslash `\` for inline formatting.

How do you type a Backtick in Markdown?

From the Code section of the Markdown syntax page: To include a literal backtick character within a code span, you can use multiple backticks as the opening and closing delimiters: ``There is a literal backtick (`) here. ``


1 Answers

I think the easiest solution is to use another way of addressing the variable:

`r get('statistical value of life in millions of 2006 dollars')`
like image 199
Konrad Rudolph Avatar answered Oct 23 '22 17:10

Konrad Rudolph