project organization with R [duplicate]

与世无争的帅哥 提交于 2019-12-06 05:06:19

Some thoughts on research project organisation here:

http://software-carpentry.org/4_0/data/mgmt/

the take-home message being:

  • Use Version Control for your programs
  • Use sensible directory names
  • Use Version Control for your metadata
  • Really, Version Control is a good thing.

My analysis is a knitr document, with some external .R files which are called from it.

All data is in a database, but during my analysis the processed data are saved as .RData files. Only when I delete the RData, they are recreated from the database when I run the analysis again. Kinda like a cache, saves database access and data processing time when I rerun (parts of) my analysis.

Using a knitr (Sweave, etc) document for the analysis enables you to easily write a documented workflow with the results included. And knitr caches the results of the analysis, so small changes do usually not result in a full rerun of all R code, but only of a small section. Saves quite some running time for a bigger analysis.

(Ah, and as said before: use version control. Another tip: working with knitr and version control is very easy with RStudio.)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!