cderv
2
Have a look at knit_child()
and knit_expand()
as a way to programmatically create R Markdown content.
This will be better than just using cat()
by insuring that content like chart are properly included in output.
You can search for this topic on this website, and you'll find plenty of example I believe.
Hope it helps
(BTW FAQ: How to Format R Markdown Source - please do format correctly you code content. Thank you)