Project Structure

Fonti Kar & Emi Tanaka

Australian National University

2025-07-14

Motivating example

When we enter a new kitchen where do you go to find:

  • cutlery?
  • drinking glasses?
  • rubbish bin?

Motivating example

When we enter a new project where do you go to find:

  • code?
  • data?
  • supporting information?

Motivating example

When we enter a new project where do you go to find:

  • code?
  • data?
  • supporting information?

A well thought-out project directory should feel intuitive and effortless! ✨

The alternativeβ€¦πŸ’”

  • Very slow to get started
  • Sharing data via emails
  • Dropbox/Cloud conflicted copies

A consistent format and understanding will make life easier πŸ’—

No need to start from scratch πŸ‘©β€πŸ³

https://github.com/anu-aagi/template-project

template-project/                 # Root of the project folder (rename)
β”‚
β”œβ”€β”€ README.qmd                    # Edit this one
|── README.md                     # Automatically generated from .qmd
β”‚
β”œβ”€β”€ data/                         # Raw and derived data
|
β”œβ”€β”€ code/                         # Scripts  to run analysis
|
β”œβ”€β”€ outputs/                      # Outputs (code generated)
β”‚
β”œβ”€β”€ misc/                         # Misc documents
|
β”œβ”€β”€ .git/                         # Git tracking folder
β”œβ”€β”€ .gitignore                    # Files/folders to be ignored by git
|── .Rproj                        # RStudio project file

README: The landing page

https://github.com/anu-aagi/template-project

template-project/                
β”‚
β”œβ”€β”€ README.qmd                    # Edit this one
|── README.md                     # Automatically generated from .qmd
β”‚

Data

https://github.com/anu-aagi/template-project

template-project/                 
β”‚
β”œβ”€β”€ data/                         # Raw and derived data
|   β”œβ”€β”€ README.md                 # When and how data was received
β”‚   β”œβ”€β”€ data-raw/                 # Read-only files
β”‚   β”œβ”€β”€ data-input/               # Extracted and coerced from raw data
β”‚   └── data-valid/               # Edit and imputed from input data

Code

https://github.com/anu-aagi/template-project

template-project/                 
β”‚
β”œβ”€β”€ code/                         # Scripts  to run analysis
|   |__ 00_utils.R                # Custom functions 
|   |__ 01_data-prep.R            # Prepare input and valid data
|   |__ 02_purpose.R
|   |__ 03_purpose.R

Regeneratable outputs

https://github.com/anu-aagi/template-project

  • Generated by content in code/
template-project/                 
β”‚
β”œβ”€β”€ outputs/                      # Outputs 
β”‚   β”œβ”€β”€ stats/                    # Analysed results (R objects, .csv, etc.)
β”‚   β”œβ”€β”€ figures/                   # Figures (.png, .pdf, etc.) 
β”‚   β”œβ”€β”€ paper/                    # Paper format (delete if not applicable)
β”‚   └── report/                   # Report format (delete if not applicable)

Everything else

https://github.com/anu-aagi/template-project

template-project/                 
β”‚
β”œβ”€β”€ misc/                         # Misc documents
β”‚   β”œβ”€β”€ unsorted/                 # Unsorted files
β”‚   β”œβ”€β”€ images/                   # Images (not created by code)
β”‚   β”œβ”€β”€ notes/                    # Read-only files
β”‚   └── meetings/                 # Edit and imputed from input data

Key takeaways

  • Project structure gives you and your team an unspoken understanding
    • Keeps your workspace organised
  • This gives makes your work intuitive and efficient
  • A solid project structure sets the foundation for more reproducible workflows