R code inside mathematical notation R Markdown

In R Markdown, I can get a built-in snippet of r code that will execute inside a single notation $(only from *to), but not a double $$mathematical notation:

* $H_o = `r 1 + 1`$

works, but:

$H_o = `r 1 + 1`$

does not work, and does not:

$$H_o = `r 1 + 1`$$

Double is $$more flexible, able to put mathematical notation on several lines, but how can you add in-line code fragments inside?

+4
source share
1 answer

, ! pdf github.md . rmarkdown.

R 3.4.1, knitr 1.16 rmarkdown 1.6.

, rmarkdown knitr. , , dev, , .

+2

Source: https://habr.com/ru/post/1682449/


All Articles