froggeR

R CMD check: passing Lifecycle: stable Tests: passing CRAN downloads

froggeR: Structured project standards for R and Quarto

Most programming languages have conventions for where files belong. R rarely agrees on one, and it shows. Scripts, Quarto documents, stylesheets, and data files pile up in root directories like laundry on a chair. froggeR offers a standard: R/ for scripts, pages/ for Quarto documents, data/ for data files, www/ for assets. Build habits that carry over whether you’re writing an analysis, building an R package, or picking up a new language entirely.

Table of Contents

Why froggeR?

froggeR gives every project the same enforced layout so you spend time analyzing, not organizing:


Installation

install.packages("froggeR")

🎯 Project Creation

Initialize a complete project with a single command:

froggeR::init(path = "my_new_project")

This creates:

my_new_project/
β”œβ”€β”€ R/
β”‚   β”œβ”€β”€ _data_dictionary.R   # Variable labels and metadata
β”‚   β”œβ”€β”€ _libraries.R         # Centralized package loading
β”‚   └── _load.R              # Sources everything. Your entry point.
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ index.qmd            # Main Quarto document
β”‚   └── references.bib       # Bibliography
β”œβ”€β”€ www/
β”‚   β”œβ”€β”€ custom.scss           # Custom styling
β”‚   └── tables.js             # Table enhancements
β”œβ”€β”€ logos/                    # Brand logos
β”œβ”€β”€ data/                     # Data files (gitignored)
β”œβ”€β”€ _brand.yml                # Quarto brand configuration
β”œβ”€β”€ _quarto.yml               # Quarto project configuration
β”œβ”€β”€ _variables.yml            # Author metadata
β”œβ”€β”€ .gitignore                # Opinionated git protection
β”œβ”€β”€ .pre-commit-config.yaml   # Pre-commit hook configuration
└── README.md

πŸ”§ Configuration & Reusability

froggeR stores configuration at two levels: global (system-wide) and project-local. Set it up once, and every future project inherits your settings.

froggeR::write_variables() # Create/edit _variables.yml (author metadata)
froggeR::write_brand()     # Create/edit _brand.yml (colors, logos, typography)

Both functions create the file if it does not exist, or open it for editing if it does. New files start from your global config or the remote template. When you’re happy, persist to global config:

froggeR::save_variables()  # Save project metadata for reuse
froggeR::save_brand()      # Save project branding for reuse

Global settings populate every new project created with init(). Edit the project copy directly when you need something specific.

πŸ“ Templated Quarto Documents

Quickly generate new Quarto documents with pre-formatted headers:

froggeR::write_quarto(filename = "monthly_report")

Your saved metadata automatically populates author information and branding.

πŸ›‘οΈ Enhanced Git Protection

froggeR includes a .gitignore that covers R artifacts, Quarto build files, data files, and common sensitive patterns:

froggeR::write_ignore()

One set of rules. Comprehensive by default. If your project needs additional exclusions, edit .gitignore directly.

🌟 Custom Styling Made Easy

Generate a SCSS template for custom document styling:

froggeR::write_scss()
froggeR::write_scss("tables")

Provides a formatted stylesheet with:

Customize your document’s appearance by uncommenting desired styles.


Function Reference

Function Description
init() Initialize a complete project from the latest remote template
quarto_project() Removed. Use init() instead
write_quarto() Create a Quarto document in pages/
write_variables() Create a _variables.yml metadata file
write_brand() Create a _brand.yml brand configuration file
save_variables() Save project _variables.yml to global config
save_brand() Save project _brand.yml to global config
write_ignore() Create an opinionated .gitignore
write_scss() Create a custom.scss styling template in www/

Getting Help


Contributing

We welcome contributions and ideas! Here’s how you can help:


License

froggeR is licensed under the MIT License. See the LICENSE file for details.


Acknowledgments

froggeR is built with these excellent packages: - cli - User-friendly command line interfaces - fs - Cross-platform file system operations - here - Project-oriented workflows - usethis - Workflow automation - rappdirs - Cross-platform configuration paths


Developed by Kyle Grealis