Skip to content
/ r-p3-template Public template
generated from CorneeldH/r-p3-template

🚧 [IN DEVELOPMENT] - A template for structuring R projects

License

Notifications You must be signed in to change notification settings

cedanl/r-p3-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

P3 Template

P3 Template | Project, Process, Presentation

πŸš€ Comprehensive R Project Structure for Efficient Workflows πŸ› οΈ
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

πŸ“‹ Table of Contents

πŸ’‘ Motivation

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

What P3 Stands For:

  • 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

πŸš€ Quick Start

  1. Ensure you have R (>= 4.0.0) and RStudio installed.

  2. Click "Use this template" in the top right corner

  3. Clone your new repository and navigate to it:

git clone https://github.com/yourusername/your-repo-name.git
cd your-repo-name
  1. 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): 
  1. 🚧 Explore the template🚧:
  • Open how-to.qmd for a step-by-step guide
  1. To see the use of this template in other projects look instroomprognose-mbo.

Troubleshooting:

  • If you encounter package installation issues, try updating R and RStudio to their latest versions.
  • For renv-related problems, refer to the renv documentation.

🌟 Features

  • 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

πŸ“ Project Structure

🚧 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)

🀝 Contributing

  • 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

πŸ“„ License

This project is licensed under the Apache License.

πŸ“š Additional Resources

About

🚧 [IN DEVELOPMENT] - A template for structuring R projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages