Extract R code from Rmd document

| category RStudy  | tag R  kintr 
library(knitr)

Extract R code only

purl("test.Rmd")


processing file: test.Rmd
|                                                                       
  |                                                                 |   0%
  |                                                                       
  |.................................................................| 100%
output file: test.R
[1] "test.R"

Extract R code and also include documentation

purl("test.Rmd", output = "test2.R", documentation = 2)


processing file: test.Rmd
|                                                                       
  |                                                                 |   0%
  |                                                                       
  |.................................................................| 100%
output file: test2.R
[1] "test2.R"

Previous     Next