1

Is there a way to programmatically change the chunk label in an r markdown document? I need to know because I use the same chunks more than one time as part of child-rmarkdown rendering.

This is an example of what I intended (and yes I know this code doesn't work). Has anyone a brilliant idea?

---
output:
  pdf_document: 
    latex_engine: xelatex
mainfont: Calibri Light
---

```{r results="asis", eval=TRUE, echo=FALSE, message=FALSE, error=FALSE}
i <- 1
```

```{r paste0("graphname",i), results="asis",eval=TRUE,echo=FALSE,message=FALSE, error=FALSE, warning=FALSE, comment = "",fig.height=1.6,fig.width=5.8,include=FALSE, fig.path="plots/"}
library(ggplot2)
qplot(c(1,2,3),c(2,3,4))
```
camille
  • 16,432
  • 18
  • 38
  • 60
rdatasculptor
  • 8,112
  • 14
  • 56
  • 81
  • Perhaps [this](http://stackoverflow.com/questions/12095113/r-knitr-possible-to-programmatically-modify-chunk-labels) helps – akrun Apr 21 '17 at 12:48
  • @akrun, I came across that same issue, but I couldn't figure out how It could help me with my specific problem. I will take a second look. – rdatasculptor Apr 21 '17 at 12:53

0 Answers0