library(knitr)
knitr_example = function(...) system.file("examples", ..., package = "knitr")
if (Sys.which("aspell") != "") {
# -t means the TeX mode
utils::aspell(knitr_example("knitr-minimal.Rnw"), knit_filter, control = "-t")
# -H is the HTML mode
utils::aspell(knitr_example("knitr-minimal.Rmd"), knit_filter, control = "-H -t")
}
Run the code above in your browser using DataLab