如何使用R中的reporteRs向docx文档添加日期?

如何使用R中的reporteRs向docx文档添加日期?,r,reporters,R,Reporters,我只能在reporteRs中找到有关向pptx文档中添加日期(理想情况下是基于报告运行时间的当前日期)的信息。有没有办法将当前日期添加到docx文档中 谢谢大家! 试试看 library( ReporteRs ) mydoc = docx( ) mydoc = addParagraph( mydoc, value = as.character(Sys.time()), stylename = "Normal" ) mydoc = addParagraph( mydoc, value = as.c

我只能在reporteRs中找到有关向pptx文档中添加日期(理想情况下是基于报告运行时间的当前日期)的信息。有没有办法将当前日期添加到docx文档中

谢谢大家!

试试看

library( ReporteRs )
mydoc = docx( )
mydoc = addParagraph( mydoc, value = as.character(Sys.time()), stylename = "Normal" )
mydoc = addParagraph( mydoc, value = as.character(Sys.Date()), stylename = "Normal" )
writeDoc( mydoc, file = tf <- tempfile(fileext = ".docx"))
shell.exec(tf)
图书馆(记者)
mydoc=docx()
mydoc=addparagration(mydoc,value=as.character(Sys.time()),stylename=“Normal”)
mydoc=addparagration(mydoc,value=as.character(Sys.Date()),stylename=“Normal”)

writeDoc(mydoc,file=tf)很有趣。你在哪里找的?谢谢!这很好,我感谢你的帮助。