Reproducible Reporting with RMarkdown

Posted by Adobe on August 16, 2016 | - view

示意图

Why Use R Markdown
To me, the strongest argument is that everything is in one place. In graduate school, I did quite a bit of work with Excel and SPSS. Not everything was coded. I would be hard-pressed to perfectly recreate every ANOVA result, every mean, every p-value. With R Markdown, you don’t get a final report unless the code runs perfectly throughout the document.

  • Documents with embedded code are reproducible
  • The document will serve as a record for how you arrived at the results you include in your papers
  • You can pass on your code to readers in addition to the report content
  • Dynamic documents can change as data are updated
  • Documents can also be used for future data releases and/or different subsets of data

R是当下相当火的统计语言,其数据统计,可视化作图功能强大。
简单讲下以前我是如何用R的。代码放在一个TXT文档里,结果报告用WORD另外写,图表数据集中在一个文件夹内。每次运行时,总是复制一行运行一行记录一行。现在想想,真的是低效之极。思维并没有形成一个真正意义上的“Project”的概念。
假期对于可重复性研究的实现颇感兴趣,但出于一些原因,资料一直放在OneTab里躺着,迟迟尚未学习。今日碰巧翻到,故仔细学习了一下,发现又一款利器。
RProject+RMarkdown+knitr+Rpubs,能够完美地组装成一条生产线,实现从源数据→数据处理→数据分析→数据可视化→动态报告→发布的功能。
可重复性研究不仅涉及到科研的严谨性、可重复性,而在于对数据分析结果的科学管理,利人利己。 一份好的报告,既能简洁明了展示结果,又能方便交流与后期校正,何乐而不为?

以下是一些比较好的资源:
RStudio 中的 R Markdown - 简书
RMarkdown速查表
Reproducible Reporting with RMarkdown