In this video, I show how to organize your R projects for easier maintenance and reuse. I help Alberto Espinoza work on a sprawling script that handles everything—data loading, cleaning, analysis, and visualization—and show how to:
- Separate data cleaning and analysis into distinct scripts.
- Save cleaned data as RDS files for efficiency.
- Structure your project with folders for raw and processed data.
- Use source() to streamline workflows.
Read the corresponding blog post, which includes the code used: https://rfortherestofus.com/2025/02/from-overwhelm-to-organization-optimizing-data-workflows-in-r