我直接在 RStudio 中使用 redoc 输出并单击“knit”,从 rmarkdown 文件创建了一个 word 文件。这工作正常。
---
title: "Untitled"
output:
redoc::redoc
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## GitHub Documents
This is an R Markdown format used for publishing markdown documents to GitHub. When you click the **Knit** button all R code chunks are run and a markdown file (.md) suitable for publishing to GitHub is generated.
## Including Code
You can include R code in the document as follows:
```{r cars}
summary(cars)
```
但试图将其转换回 Rmd 会引发错误。其他人有过吗?
redoc::dedoc(docx = "test.docx",overwrite = TRUE)
Error in convert_docx_to_md(docx, track_changes, wrap, verbose, md_only) :
lazy-load database '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rmarkdown/R/rmarkdown.rdb' is corrupt
In addition: Warning messages:
1: In convert_docx_to_md(docx, track_changes, wrap, verbose, md_only) :
restarting interrupted promise evaluation
2: In convert_docx_to_md(docx, track_changes, wrap, verbose, md_only) :
internal error -3 in R_decompress1