Executing external source in knitr and printing the external code chunk

后端 未结 1 327
北荒
北荒 2020-12-19 18:59

I use ProjectTemplate and Knitr to produce reports. Most of the analysis is stored in the src directory, whilst the report contains the presentation R markdown.

I

相关标签:
1条回答
  • 2020-12-19 19:53

    You may try this:

    In the main body:

    ```{r runanalysis, code=readLines('../src/rf-model-caret.R'), echo=FALSE, eval=TRUE}
    ```
    

    In the appendix:

    ```{r runanalysis, code=readLines('../src/rf-model-caret.R'), echo=TRUE, eval=FALSE}
    ```
    
    0 讨论(0)
提交回复
热议问题