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 “library(knitr); knit()”, and even better, to send R code chunks to R from within the editor directly.