Yihui Xie
2013/07/24 @ Raphael Gottardo's Research Lab
3 steps of publishing a book

library(knitr)
# knit('input_file.ext'); for example
knit("whatever.Rmd") # ==> whatever.md
knit("whatever.Rnw") # ==> whatever.tex
#', and code as usual#+
system.file('examples', 'knitr-spin.R', package = 'knitr')#' today I built a model
fit = lm(dist ~ speed, data = cars)
#' and I got the slope `r coef(fit)[2]`
#+ dist-speed, fig.width=5, fig.height=4
plot(cars)
abline(fit)
lazyLoad(): do not load unless it is really used anywheredependson: chunk B depends on chunk Adep_prev()<<label>> to embed one chunk into anotherref.labelchildknit_hooks$set(hook_name = function(x, options) { whatever you want})knit_hooks$set(new_name = function(before, options, envir) { whatever you want })engine option, e.g. engine = 'python', engine = 'awk'knitr-examples/.*engine.*.Rmd (e.g. 023)knit(text = 'construct your document here')# ---- label, options ----read_chunk()data, R, man, tests, demo, src, vignettesVignetteBuilder: knitr in DESCRIPTION\VignetteEngine{knitr::knitr} in vignettesyou will tell your colleagues

stop cut-and-paste! let's use knitr!