rbranding
Manage Branding and Accessibility of R Projects
A tool for building projects that are visually consistent, accessible, and easy to maintain. It provides functions for managing branding assets, applying organization-wide themes using 'brand.yml', and setting up new projects with accessibility features and correct branding. It supports 'quarto', 'shiny', and 'rmarkdown' projects, and integrates with 'ggplot2'. The accessibility features are based on the Web Content Accessibility Guidelines <https://www.w3.org/WAI/WCAG22/quickref/?versions=2.1> and Accessible Rich Internet Applications (ARIA) specifications <https://www.w3.org/WAI/ARIA/apg/>. The branding framework implements the 'brand.yml' specification <https://posit-dev.github.io/brand-yml/>.
README
# ggplot2 Branding Integration Example
This directory contains examples of how to integrate ggplot2 visualizations with brand themes using the `rbranding` package.
## Files
- `example.R` - Main example script demonstrating the complete workflow
- `README.md` - This file
## Quick Start
1. Install and load the package:
```r
# Install from GitHub
remotes::install_github("EpiForeSITE/rbranding")
library(rbranding)
```
2. Set up branding (run once):
```r
brand_init()
get_brand()
```
3. Apply brand theme and create plots:
```r
library(ggplot2)
brand_set_ggplot()
# Your plots will now use brand colors and fonts
ggplot(mtcars, aes(x = mpg, y = wt)) +
geom_point() +
labs(title = "Branded Plot")
```
4. Optionally add logo:
```r
# Add brand logo to plot
ggplot(mtcars, aes(x = mpg, y = wt)) +
geom_point() +
brand_add_logo()
```
5. Reset when done:
```r
brand_reset_ggplot()
```
## Requirements
- R packages: `ggplot2`, `yaml`
- Optional: `sysfonts`, `showtext` (for custom fonts)
- Optional: `plotly` (for interactive plots)
- Optional: `png`, `grid` (for logo functionality)
## Troubleshooting
If you encounter font loading issues, disable custom fonts:
```r
brand_set_ggplot(use_fonts = FALSE)
```
For more details, see the package vignette:
```r
vignette("ggplot2-integration", package = "rbranding")
```Versions across snapshots
| Version | Repository | File | Size |
|---|---|---|---|
0.1.1 |
rolling linux/jammy R-4.5 | rbranding_0.1.1.tar.gz |
1.6 MiB |
0.1.1 |
rolling linux/noble R-4.5 | rbranding_0.1.1.tar.gz |
1.6 MiB |
0.1.1 |
rolling source/ R- | rbranding_0.1.1.tar.gz |
1.9 MiB |
0.1.1 |
latest linux/jammy R-4.5 | rbranding_0.1.1.tar.gz |
1.6 MiB |
0.1.1 |
latest linux/noble R-4.5 | rbranding_0.1.1.tar.gz |
1.6 MiB |
0.1.1 |
latest source/ R- | rbranding_0.1.1.tar.gz |
1.9 MiB |
0.1.1 |
2026-04-26 source/ R- | rbranding_0.1.1.tar.gz |
1.9 MiB |
0.1.1 |
2026-04-23 source/ R- | rbranding_0.1.1.tar.gz |
1.9 MiB |
0.1.1 |
2026-04-09 windows/windows R-4.5 | rbranding_0.1.1.zip |
1.6 MiB |