I would like to know if it is possible and what is the best way to programmatically create html section headings in a Rmarkdown code chuck. Specifically, I am trying to create section headings and plots dynamically within a loop. The example below illustrates a loop with 3 iterations, but in actuality, my code will exist in a Rmarkdown template which will process data of variable size and content so the number of iterations and headings is a priori unknown.
Unfortunately, this does not address my initial question. I am trying to dynamically set the section titles within the html document, not the main document title.