knit_exit: Exit knitting early

View source: R/output.R

knit_exitR Documentation

Exit knitting early


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().


knit_exit(append, fully = TRUE)



A character vector to be appended to the results from knit() so far. By default, this is ‘⁠\end{document}⁠’ for LaTeX output, and ‘⁠</body></html>⁠’ for HTML output, to make the output document complete. For other types of output, it is an empty string.


Whether to fully exit the knitting process if knit_exit() is called from a child document. If FALSE, only exit the knitting process of the child document.


Invisible NULL. An internal signal is set up (as a side effect) to notify knit() to quit as if it had reached the end of the document.


# see

knitr documentation built on Nov. 2, 2023, 5:49 p.m.