R Projects and Folder Structure
Table 1
Table
6 / 9
Table 1
Table
Table 1
| Folder | Contents | Good practice | Common risk if unmanaged |
|---|---|---|---|
| `data_raw` | Unmodified source exports | Treat as read-only and keep original filenames or date-stamped filenames | Accidental changes to source files |
| `data_clean` | Derived datasets generated by scripts | Recreate from scripts when rules change | Confusion between original and modified data |
| `scripts` | R scripts used for import, checking, cleaning, and reporting | Use clear names and keep scripts under version control when possible | Untraceable manual work |
| `outputs` | Reports, query lists, figures, tables | Date-stamp or version outputs where useful | Reports overwritten without record |
| `documentation` | Protocol, DMP, data dictionary, CRF guides | Keep study definitions near the code | Checks drift away from protocol definitions |