我在Downloadhandler中下载Word文件时遇到问题。在我无法报告之前,ReporteRs将表插入到Word文件中,然后作为以下链接http://davidgohel.github.io/ReporteRs/articles/bookmarks.html下载。
但是,ReporteRs已被删除,我可以使用哪个函数/程序包替换“ WriteDoc”?这是我的代码:
output $ download1 = downloadHandler(
filename = function(){
paste("InternalRequest_",Sys.Date(),".docx", sep ="")
},
content = function(file){
ft <- flextable(t1())
ft <- theme_vanilla(ft)
doc = read_docx(path="C:Desktop\\Internal Request.docx")
doc<-doc%>%cursor_bookmark("DATA")
doc<-body_add_flextable(doc, ft, pos = "on")
writeDoc(doc, file = file)
})