可以通过 RStudio GUI(文件 --> 新建 --> R Markdown --> 高级 Word 文档)打开的模板不会编织。 我根本没有更改文档模板; 如果我使用Ctrl + Shift + k
rmarkdown
会引发错误:
Quitting from lines 73-74 (officedown-word-doc-template.Rmd)
Error: read_docx only support docx files
我今天刚刚使用 `install.packages("officedown") 下载了这个包,所以它应该是 0.2.0 版本。
以下是运行sessionInfo()
的结果:
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
loaded via a namespace (and not attached):
[1] Rcpp_1.0.5 digest_0.6.26 R6_2.4.1
[4] magrittr_1.5 officedown_0.2.0 evaluate_0.14
[7] zip_2.1.1 gdtools_0.2.2 rlang_0.4.8
[10] uuid_0.1-4 xml2_1.3.2 rmarkdown_2.4
[13] tools_4.0.3 officer_0.3.15.005 xfun_0.18
[16] yaml_2.2.1 compiler_4.0.3 systemfonts_0.3.2
[19] rvg_0.2.5 memoise_1.1.0 htmltools_0.5.0
[22] knitr_1.30
任何帮助将不胜感激。
谢谢,你能提供getwd()
的结果吗? 里面有没有空格(如“C:/blah blah”)?
好的,我找到了问题的根源,它已在officer中修复,而不是officedown。 您将需要从 github 更新官员,直到新版本在 CRAN 上:
remotes::install_github("davidgohel/officer")
惊人的! 我安装了officedown和officedown的开发版本,现在编写示例可以正常工作。 谢谢 !
感谢您的帮助以及您在此处编写的出色软件包。