Structure your project as an R package
Question: Should the Netherlands extend COVID-19 vaccination to adolescents and children?
Timeline: ~2 weeks
❌ Typical Project
├── analysis.R
├── analysis_v2.R
├── FINAL_analysis.R
├── analysis_FINAL_v3.R
├── data_raw.csv
├── functions_maybe.R
├── temp_script.R
└── random_test.R
✅ Package Structure
📦 mypackage/
├── R/ # Code
├── data/ # Data
├── man/ # Help files
└── vignettes/ # Analysis
❌ Separate Documents
├── analysis.R
├── methodology.docx
├── code_guide.pdf
├── final_report.pdf
├── final_report_FINAL.pdf
└── README.txt
✅ Integrated Package
📦 mypackage/
├── R/ # Code
├── man/ # Help files
└── vignettes/ # Docs + Reports
└── analysis.Rmd → 📊 Report.pdf
→ 🌐 Website
Writing the help files as you write the code, so they can be documented in real time
[show screen shot of roxygen preamble and generated help file]
Vignettes
Steps 1-2
+
Sharing Platform
=
✨ Magic ✨
Incorporated into
epidemics
package transmission model library
📉 Used to inform European-wide disease modeling
:globe_showing_europe_africa: One national analysis became international infrastructure
I’ve just submitted my first R package to CRAN!
posit::conf(2025) | 18 September 2025 | Atlanta, GA