I am writing about how to use R Markdown, and find that I am having to use R Markdown to write about R Markdown. I understand the notion of using regular markdown and enclosing R code chunks within standard markdown, but I don't understand the following example from the source code for " R Markdown: The Definitive Guide" (Chapter 2):
```{r include=FALSE}
b = '`r b[1]`' # an ugly hack; don't look at me
```
````markdown
This is a paragraph in an R Markdown document.
Below is a code chunk:
`r ''````{r}
fit = lm(dist ~ speed, data = cars)
b = coef(fit)
plot(cars)
abline(fit)
```
The slope of the regression is `r b[1]`.
````
Is there a reference for the syntax `r''````{r} line somewhere? Can someone explain what it does and why the "ugly hack" needed?