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
knit
You can use knit_child() instead of knit() in some_function():
knit_child()
knit()
some_function()
library(knitr) some_function <- function(){ knit_child(text =" ```{r } 1 ``` ") } cat(knit(text =" ```{r } some_function() ``` ```{r } some_function() ``` "))