Include R code in an Rmarkdown figure caption
Here how to include R code in an Rmarkdown with figure caption and then save to PDF file.
Use fig_caption: true in your YAML and opts_knit$set(eval.after = "fig.cap")
title: "Example"
output:
pdf_document:
fig_caption: true
```{r parameters}
l...
testandoptimize.com1 min read