Chart for each dynamic Tab in Markdown

Seeking help with creating a chart for each dynamically created tab in a markdown document.

The following script works well for creating the tabs ,

What i am having trouble doing is now creating a
chart based on the fields x= Report_Date and y =Percent_Met and faceted by Measure_Name for each Measure_Name for in the Clinical_Group and Provider associated with the tab in question.

here is the script i have for creating the tabs
teams <- sort(unique(df$Team))

cat('## Teams {.tabset}\n')

for(team in teams) {
cat('### ', team, '{.tabset}\n')

providers_in_team <- sort(unique(df$Provider[df$Team == team]))

for(provider in providers_in_team) {
cat('#### ', provider, '{.tabset}\n')

clinical_groups_for_provider <- sort(unique(df$Clinical_Group[df$Provider == provider]))

for(clinical_group in clinical_groups_for_provider) {
  cat('##### ', clinical_group, '\n')


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)

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.