A template designed to streamline your R projects from setup to final presentation, powered by LLMs.
Ideal for data scientists, researchers, and R developers seeking a standardized project structure
The R project template. Built with β€οΈ by cedanl and contributors
- Motivation
- What P3 Stans For
- Quick Start
- Features
- Project Structure
- Contributing
- License
- Additional Resources
The P3 Template addresses common challenges in R project start-up, organization and reproducibility. It provides a standardized structure that:
- Enables secure and high-performance LLM-usage from the IDE.
- Improves project maintainability
- Streamlines the transition from explorative analysis to final presentation
- Project: A complete, well-organized codebase with good practices incorporated
- Process: A way-of-work and guide to help you being more productive
- Presentation: Professional, adaptable and beautiful outputs
-
Ensure you have R (>= 4.0.0) and RStudio installed.
-
Click "Use this template" in the top right corner
-
Clone your new repository and navigate to it:
git clone https://github.com/yourusername/your-repo-name.git
cd your-repo-name
- Open the project in RStudio and run the setup script by clicking Enter:
Setup script detected. Run 00_setup.R? (press ENTER to run, ESC to skip):
- π§ Explore the templateπ§:
- Open how-to.qmd for a step-by-step guide
- To see the use of this template in other projects look instroomprognose-mbo.
- If you encounter package installation issues, try updating R and RStudio to their latest versions.
- For renv-related problems, refer to the renv documentation.
- Quarto-based workflow
- Quick stream-of-consciousness programming (literate programming)
- Easily move code from development to production due due to render-functionality
- Documentation is directly next to the code
- Export text and code output (tables and visualisation) quickly to pptx, html and pdf
- Standardized project structure following R package conventions (functional programming)
- This enables automated code checks and clear structure
- Integrated renv for reproducible package management
- Built-in tidyverse packages
- Built-in LLM-enabling package and settings
- No interference with other locally installed R packages
- Automated setup script for quick initialization
- Easy customization for project defaults
- Data folders with synthetic and reference data synced and other data kept local
π§ The P3 Template follows a well-organized directory structure to enhance productivity and maintainability. Here's an overview of the key directories:
project-root/
βββ data/
β βββ synthetic/ # Synthetic data for testing and examples
β βββ reference/ # Reference data like mapping tables etc can be shared widely
βββ man/ # Auto-generated documentation
βββ R/ # R functions and scripts
βββ utils/ # Utility files and tools, all adaptable by user
βββ pal_prompts/ # AI assistant prompts for 'chores' like documentation and testing
βββ how_to.qmd # The how-to analysis file that demonstrates built-in functionality
βββ how_to_success.qmd # Potential Quarto file after all instructions are worked through successfully
βββ how_to_success.html # Visual presentation of success how-to
βββ 00_set_up.R # Ensuring all basic steps are done and project is ready-for-analysis
βββ config.yml # Configuration settings, like which data folder to use (by default synthetic)
- Thanks to Npuls for providing the opportunity to develop this package
- Thank you to CEDA-colleagues for stimulating conversations and feedback Bram, Tomer, Amir, Tony, Theo, Ash, Steven, Caspar, Shirley and Martine
- Thanks to SURF Developer Program for sparking interest in templates
Contribute as well! Please see our Contributing Guide for details.
Key ways to contribute:
- Report bugs or suggest features by opening an issue
- Submit pull requests for bug fixes or new features
- Improve documentation or add usage examples
This project is licensed under the Apache License.