I'm using RMarkdown where I'm building my analysis. The final output will be an html document. Actually I've got a core code which will be the final document and, after the end, I've got many lines of code with chunks and sentences that at the moment are not useful, but could be included in the final document.
Not just like eval=FALSE for chunks (I've got also plain text), but something like \end{document} in TeX. I don't want just to comment plain text and put eval=FALSE as chunks options.
I tried to google and read in the RMarkdown documentation, but I found nothing.
Thanks everybody! And forgive me for my poor English...
From the documentation of knit_exit():
Sometimes we may want to exit the knitting process early, and completely ignore the rest of the document. This function provides a mechanism to terminate
knit().
Example:
Text.
```{r}
print(1)
```
More text.
```{r}
knitr::knit_exit()
```
Ignored.
```{r}
print("Ignored.")
```
Everything after knit_exit() will be ignored. This works for all output formats.
The code above produces:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With