Reset a variable when iterating over a for loop R Markdown
I have an .Rmd
report that I loop over a variable to get the report to export one report per variable in the dataset. As part of my report structure, I have an incremental function to label the tables I’m generating in the report. Each individual report should start with Table 1 and iterate from there for each table. This works correctly when I just knit the .Rmd itself. But when I use an .R
script to loop over the .Rmd
script, the iteration doesn’t reset back to one between loops.