What commands are run when pressing “Knit HTML” on an R Markdown file in Rstudio 0.96?
My motivation is that I might want to run the same command when I’m in another text editing environment or I might want to combine the command in a larger makefile.
Put
Sys.sleep(30)in a chunk and you will see clearly what commands are called by RStudio. Basically they arelibrary(knitr); knit()to get the markdown file;The second step will be more transparent in the next version of the markdown package. Currently you can use
knitr::knit2html('your_file.Rmd')to get a similar HTML file as RStudio gives you.Update on 2019/09/17: The above answer applies to RStudio v0.96 (in the year 2012). Now R Markdown is compiled through
rmarkdown::render(), which uses Pandoc instead of the retired R package markdown. See the post Relationship between R Markdown, Knitr, Pandoc, and Bookdown for more details.