main.r Ties It Together
The pipeline from W5 lives in code/, run start to finish by main.r.
SPEA V706 — Statistics for Research in Public Affairs
.Rproj, that makes here() work.Rprojproject.Rprojhere() keys off this file — it finds the root, then builds paths down from theresetwd(). The .Rproj sets the location for youproject.Rproj to open the projectproject/
├── project.Rproj # the here() anchor
├── code/ # scripts + main.r
├── raw_data/ # original data (read-only)
├── temp_data/ # intermediate files
├── outputs/ # tables/ and figures/
├── manuscript/ # the paper
└── README.md # what & how to run
raw_data/ holds the original files exactly as they arrived. You never edit themmain.r Ties It TogetherThe pipeline from W5 lives in code/, run start to finish by main.r.
Starting fresh, you make the skeleton yourself.
code/, raw_data/, temp_data/, outputs/.Rprojmain.r stub in code/ and a README.md at the rootraw_data/ and start writing 01_clean_data.rmain.r stub, a .gitignore, and a README on day one.gitignoreSome files should never go into version control. .gitignore lists them.
# Data: too large for git; add it locally
raw_data/**
!raw_data/**/README.md
temp_data/
# R artifacts
.Rhistory
.RData
.Rproj.user
# OS clutter
.DS_Store
.Rproj, so here() and reproducibility just workmain.r rebuilds all results from raw data in one run.gitignore keeps data and artifacts out of git