I'm running into a duplicate label error when I call a function that uses knit
inside a knit
call. If I label the chunks the problem goes away. Is there a way to call some_function
in a way that doesn't collide with the parent knit
call?
library(knitr)
some_function <- function(){
knit(text ="
```{r }
1
```
")
}
cat(knit(text ="
```{r }
some_function()
```
```{r }
some_function()
```
"))
Output:
```r
some_function()
```
```
## Error: duplicate label 'unnamed-chunk-1'
```