我尝试使用R Markdown来编写所有的数据分析报告,因为我可以拥有一个可以以多种输出格式(Pdf、html和MS Word)共享的可重现文档。
然而,我的大多数同事都在使用MS Word,他们对R、Markdown等一无所知。
使用R Markdown的一个好处是,我可以在MS Word中生成我的报告,并直接与我的同事分享。
缺点是协作对我来说变得很麻烦,因为我也会收到MS Word上的反馈(通常使用跟踪更改),并且我必须手动将这些更改重新引入.rmd文件中。
因此,我的问题是:我如何简化将MS Word文档中的更改导入.Rmd的过程(即使其尽可能自动化)?
有没有什么工具可以帮我呢?
P.s.getting我的同事成为R文字是不是一个选择:(
发布于 2017-05-17 15:03:42
我还没有尝试我的建议,但这里是我计划如何处理这个问题,因为我有完全相同的需求。首先,有两种截然不同的场景:
<!--- Pandoc-enhanced HTML comment -->)是我可能会使用use.中应该很简单
我想指出的是,似乎唯一不那么容易的部分(与Microsoft Word的正常工作功能相比)是用diff替换跟踪更改。我不知道有什么工具可以使合并diff文件像Word如何协调更改一样简单,但如果这样的工具存在,那么这个过程应该更加无缝。
发布于 2018-05-13 01:30:43
我认为我们需要在几个包上工作,以便在Word和RMarkdown用户之间实现真正的协作。我很乐意与任何有兴趣实现这一目标的人合作。
- Generate a key (paragraph)->(lines) that matches paragraphs scraped from Word (without any of the tracked changes) to lines in the RMarkdown. The problem is that we don't know what was generated using code, and what was directly written as Rmd. The first step would be to find lines in the RMarkdown file that should form paragraphs (exclude R chunks, but not inline R). Then, ensuring the order remains the same, compare these lines (remove newlines) to paragraphs scraped from the Word document, using a regexp symbol for "any char, any length" in the place of inline r chunks. Next, split paragraphs with inline chunks as into sub-paragraphs in order to be able to apply tracked changes and comments to either the inline code, before, or after the inline chunk more easily. Finally, the paragraphs that could not be matched were likely generated within code chunks and should be matched to the appropriate code chunks, determined from the order of the paragraphs.
- Use the generated key, apply tracked changes (as CritcMarkup) to the RMarkdwown file. Any changes made to code chunks should be reported as a CrticMarkup comment around that code chunk (or group of code chunks if there is no markdown in between chunks).
发布于 2020-12-18 01:25:12
我知道这是一个老帖子,但对于未来的提问者,现在有一个包可以(主要)做到这一点:
{redoc} package可以输出到Word,通过在Word文档内部存储R代码,它还可以将Word文件dedoc()回RMarkdown。它使用了另一个答案中讨论的批判性标记语法。
https://stackoverflow.com/questions/35945728
复制相似问题