knitr - exclude chunks from `purl(…)`?

后端 未结 3 1294
死守一世寂寞
死守一世寂寞 2021-01-01 14:27

When I purl/tangle a document to extract the R chunks into a script, is there any way to:

  • exclude an arbitrary chunk (by name say)?
  • if not, exclude a
3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-01 14:58

    Since knitr 1.3, there is a new chunk option purl = TRUE/FALSE that allows one to include/exclude certain code chunks for purl().

    ```{r test, purl=FALSE}
    library(MASS)
    ```
    

提交回复
热议问题