Mass create documents in R markdown

ぃ、小莉子 提交于 2019-12-03 14:10:49

Use the render function and pass a list of names to the function:

renderMyDocument <- function(name) {
  rmarkdown::render("./printing_procedures/dagr_parent.Rmd",
                    params = list(names = name),

                    output_file = paste("~/document_", name, '.doc', sep = '')
  )
}

lapply(names, renderMyDocument)

Then just make sure your RMD file can take the params argument via the YAML:

---
params:
  names:  
---    

RStudio documentation on parameterized reports here: https://rmarkdown.rstudio.com/developer_parameterized_reports.html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!