Building on the post How to efficiently manage a statistical analysis project and the
ProjectTemplate package in R...
Q: How do you build your statistical project directory structure when multiple languages feature heavily (e.g, R AND Splus)?
Most of the discussions on this topic have been limited to projects which primarily use one language. I'm concerned with how to minimize sloppiness, confusion, and breakage, when using multiple languages.
I've included below my current project structure and methods for doing things. An alternative might be to separate code so that I have
./Splus directories---each containing their own
Q: Which approach would be closest to "best practices" (if any exist)?
- /data - data shared across projects
- /libraries - scripts shared across projects
- /projects/myproject - my working directory. Currently, if I use multiple languages they share this location as their working directory.
- ./data/ - data specific to
/myprojectand symlinks to data in
- ./cache/ - cached workspaces (e.g.,
.RDatafiles saved using
save.image()in R or
.sddfiles saved using
- ./lib/ - main project files. Same across all projects. An R project will be run via
source("./lib/main.R")which in turn runs
.report.R. Currently, if multiple languages are being used, say, Splus in addition to R, I'll throw
clean.ssc, etc. into this directory as well. Not sure I like this though.
- ./src/ - project-specific functions. Collected one function per file.
- ./util/ - general functions eventually to be packaged. Collected one function per file.
- ./tests/ - files for running test cases. Used by
- ./munge/ - files for cleaning data. Used by
- ./figures/ - tables and figure output from
./lib/report.Rto be used in the final report
- ./report/ -
.texfiles and symlinks to files in
- ./presentation/ -
.texfiles for presentations (usually the
- ./temp/ - location for temporary scripts
- ./.RData - for storing R project workspaces
- ./.Data/ - for storing S project workspaces