Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当重用包含绘图的块时,未正确引用绘图,即它们对于两个块来说是相同的,尽管它们应该是不同的。我能做些什么呢?
## Test ```{r} col <- "black" ``` ```{r chunk1} plot(0, col=col) ``` ```{r} col <- "red" ``` ```{r chunk1} ```
您应该使用不同的标签,例如
```{r chunk2, ref.label='chunk1'} ```
见http://yihui.name/knitr/demo/reference/