Need the filename of the Rnw when knitr runs in rStudio

前端 未结 2 1146
轮回少年
轮回少年 2021-01-18 12:11

When working on a reproducible research project, I would like to know the name of the Rnw file that is being run to use as an R variable.

This would be analogous to

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-18 12:59

    knitr now has a method for this: current_input()

    https://github.com/yihui/knitr/issues/701

提交回复
热议问题