This is a good approach the for loop !
Is rx an object you use inside your Rmd document ?
If so, currently it works because by default render has access to the value of the parent frame. Another approach would be to use it as a param in the Rmd file.
You yaml header would contain
params:
rx: <default value>
and use params$rx in place of rx in your doc.
and it you call you would do
for (i in 1:NROW(zone_list=)) {
rmarkdown::render('/home/juan/Documents/recolectores/Reporte.Rmd',
output_file = paste0("Reporte_", zone_list[i], ".html"),
param = list(rx = listar[i]))
}
Parametrized report are really powerful has they allow you to get different type of outputs based on one source file. If you use product like RStudio Connect, this would be the way to go.
Anyway, your solution is completly fine ! Well done !