bramtayl
bramtayl

Reputation: 4024

How to escape backticks in 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.

Upvotes: 14

Views: 1000

Answers (2)

slackline
slackline

Reputation: 2417

Perhaps consider using a name without spaces in it (and a little shorter).

Upvotes: -3

Konrad Rudolph
Konrad Rudolph

Reputation: 545518

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')`

Upvotes: 12

Related Questions