Block start prevention in rmarkdown

I use Rmarkdown and Knitr using Rstudio.

Listed below are both print script and output in html.

 ```{r} summary(cars) ``` 

However, the following will only output the output, which is an inline chart.

 ```{r, echo=FALSE} plot(cars) ``` 

I have a situation different from the previous one, I want to present a script, but should not be launched in html, since it will take a very long time (hours, if not days) to run. So what I just did was comment mark was marked.

 ```{r} #summary(cars) ``` 

But I need a better way to do this. Is there a better way to present a script without running it.

+6
source share
1 answer
 eval = FALSE 

Checkout Cheat Sheet R Markdown http://blog.rstudio.org/2014/08/01/the-r-markdown-cheat-sheet/

It summarizes options for code snippets.

+17
source

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


All Articles