We can write documents for knitr with any text editor, because these documents are plain text files. For example, lightweight editors like Notepad under Windows or Gedit under Linux will work. The main reasons that we need special text editors are
1. we want to input R code chunks more easily, e.g., input <<>>=
and @
with a keyboard shortcut instead of typing these characters every time;
2. we wish to call R and knitr to compile source documents to PDF/HTML within an editor instead of opening R and typing the command knitr::knit()
, and even better, to send R code chunks to R from within the editor directly.
There are many mature and nice editors for , HTML, and Markdown documents, and some have integrated knitr within them, as ...
Get Dynamic Documents with R and knitr, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.