作者:小何775 | 来源:互联网 | 2023-08-17 21:08
Ineedtoautomatesomereportgeneration.Iwouldliketocreateanrmarkdownreportfromafunctio
I need to automate some report generation. I would like to create an rmarkdown
report from a function, something like
我需要自动生成一些报告。我想从一个函数创建一个rmarkdown报告,比如
make_report <- function(file_path = "data_file.txt", outfile){
# get data from external file
object <- parse_text(file_path)
# ?pass it into report template?
rmarkdown::render("report_template.Rmd", outfile)
}
Where report_template.Rmd
prints tables and figures based on the information in the data_frame
object. I've seen ways to make rmarkdown templates, but I don't know if there is a way to pass anything into them.
其中report_template.Rmd根据data_frame对象中的信息打印表格和图形。我已经看到了制作rmarkdown模板的方法,但我不知道是否有办法将任何内容传递给它们。
1 个解决方案