Apologies if I'm using the wrong or incorrect lingo/terminology, but this is exactly the same issue reported in this issue from 1.5 months ago:
https://community.rstudio.com/t/rmarkdown-does-not-show-outputs/126715
For some unknown reason, the knit function isn't processing the rcode snippets when generating a preview or the html document, even when using the stub/default text. For some unknown reason, the original poster for the previous topic never followed up, but I'm able to generate the html file correctly if I manually specify
rmarkdown::render( file_name )
The specific steps to generate the issue are:
- create new R markdown file, using File -> New File -> R Markdown
- Press ctrl-shift-k (or select File -> Knit Document)
- save html doc to whatever name you want (I chose dbg.html)
the generated html document won't contain the result of the r code, but will just contain the string literals, i.e.
{r cars} summary(cars)