12.2 Directory Structure
There is a common file structure for each project that takes the following form:
item_name | item_type | item_purpose |
---|---|---|
data | directory | Store derived data |
data-raw | directory | Store raw data |
munge | directory | Cleaning scripts which create the cleaned data objects stored in the data folder |
outputs | directory | This is where output figures and models should be placed |
report | directory | This is where the reports should be stored |
src | directory | This is where analysis scripts should be stored |
libs | directory | This is to store any helper functions that you create during the analysis |
makefile | makefile | A GNU makefile which builds the analysis |
README.Md | markdown file | A README file that describes the project origin and important features |
Again, with a sub-folder structure that looks like the following:
item_name | item_type | parent_folder | item_purpose |
---|---|---|---|
models | directory | outputs | Store derived models from the analysis |
to-be-reviewed | directory | report | Store files for editing |
released | directory | report | Store the released copies of the reports |
Additionally, there are common files that have common functions:
item_name | parent_folder | item_purpose |
---|---|---|
01-import.R | munge | Import data from stakeholder and combines with the LSDS |
02-match.R | munge | Runs a matching algorithm for causal inference if desired |
01-run-analysis.R | src | Runs several regression analysis and saves the coefficients |
02-clean-analysis.R | src | Cleans up the regression analysis for graphing and the final report |