Guide to Organizing Projects
Once you have an idea of what you want to do for your projects, it’s important to organize your working directory. If your project is organized well and everything is documented, anyone who’s unfamiliar with your project should be able to look at your files and understand what you did and why. Organize everything the way that if you come back to that project in couple months or years you will able to understand what you did and why.
Directory Layout
There are couple of reasons to have a certain structure for your project:
- Achieve reproducibility with minimal effort.
- Optimize the time looking for the files by organizing folders based on the input and output files.
- Improve the quality of the project with detailed explanations and notes as the work progresses.
Basic directory layout may look like this:
- data/
- raw/
- clean/
- code/
- functions/
- 01_process-data.R
- 02_create-figures-using-processed-data.R
- archived/
- functions/
- output/
- data-exploration-figures/
- final-figures/
- descriptive-title-for-output-file-batch/
This is just a basic example and as you progress on your project your directories will evolve. Typically, files in the directory ‘data/raw/’ should not be changed or edited for reproducibility sake.
File Naming
Once we have the basic structure down, let’s talk about naming your files.
- Files should be named consistently.
- Avoid using special characters or spaces in a file names.
- Use dashes and underscores instead of slashes, periods or spaces.
- Use date format YYYY-MM-DD.
- File names should be concise and descriptive.
Some other things to consider when naming files according to Stanford’s Data Management Services:
- Project or experiment name or acronym
- Location/spatial coordinates
- Researcher name/initials
- Date or date range of experiment
- Type of data
- Conditions
- Version number of file
- Three-letter file extension for application-specific files
Version Control
As project gets more complicated and you start collaborating with other professionals, version control is something to consider. There is a software that helps you keep track of changes done by you or fellow collaborators. To learn more about that, please check out the following blog posts:
- Intro to Git and Github by Sarah
- How to/why write good commit messages by Jordan
Note: links will be added later to those sections on the blog.