r - knitr::opts_current: 什么时候可以安全使用?
问题描述
这实际上是opts_current 的副本:它在 knitr 中是如何工作的?,但我正在寻找更广泛的答案。
我喜欢使用一般的 knitr 配方
```{r fig-this-one, fig.scap=current_scaption, fig.cap=current_caption, eval.after=c("fig.scap", "fig.cap")}
ggplot(mydata, aes(x=x, y=y)) + geom_point()
current_scaption <- "My short caption"
current_caption <- "My long caption"
```
该opts_current$set()
文档让我非常担心会不小心弄乱它,但我很好奇。eval.after
使用和有什么区别opts_current$set()
吗?基于https://github.com/yihui/knitr/issues/1656,似乎还可以。
解决方案
推荐阅读
- r - 如何从特定列中的所有实例中删除“-”?
- environment-variables - 找不到 env 文件
- xamarin.forms - SpecialFolder. 每个设备上的个人访问和位置
- neo4j - 使用导入工具导入文件时找不到 neo4j-admin 命令
- vue.js - vue-router 在商店内不推送
- java - 对于 nextInt(),Java.util.scanner 没有此类元素异常
- python - 将第二个数据源条目与主要源匹配
- python - 如何在同一个django模型的另一个值中使用一个模型的值
- python-3.x - rasterio open 和 skimage.io.read 都为我试图打开的 TIFF 返回一个 NaN 数组
- c++ - 相机抖动未激活虚幻 C++