The rbranding package is 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 other packages such as ‘ggplot2’ for producing branded graphics and visualizations.
Package Features
- Branding File Management: Download, update, and validate branding YAML files for consistent theming
- Project Templates: Quickly scaffold Shiny apps or Quarto websites that follow best practices for branding and accessibility
- Accessibility: Built-in support for accessible color palettes and UI components
-
Integration: Easily integrates with
ggplot2
bslib
,thematic
, and other modern R packages
Installation
You can install the stable version of rbranding from CRAN with:
install.packages("rbranding")
To get a bug fix or to use a feature from the development version, you can install the development version of rbranding from GitHub with:
# install.packages("remotes")
remotes::install_github("EpiForeSITE/rbranding")
Alternatively, the development version of rbranding is also available from the R-universe project at https://epiforesite.r-universe.dev/ with:
install.packages('rbranding', repos = c('https://epiforesite.r-universe.dev', 'https://cloud.r-project.org'))
Usage
Use brand_init()
to initialize the branding setup. This function generates the rbranding_config.yml
and _brand.yml
files.
The generated _brand.yml
file contains placeholder text. You will need to edit the config file with the URL of your brand file, then download that file using get_brand_public()
or get_brand_private_github()
, depending on whether your brand file is hosted publicly or in a private GitHub repository.
These same get_brand_*()
functions will also update the local _brand.yml
file, if it already exists.
Project Documentation
The full documentation for the package, including reference manuals and vignettes, is available at https://epiforesite.github.io/rbranding/.
Getting Help
If you encounter a clear bug, please file an issue with a minimal reproducible example on GitHub.
Code of Conduct
Please note that the rbranding project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Acknowledgements
This project was made possible by cooperative agreement CDC-RFA-FT-23-0069 from the CDC’s Center for Forecasting and Outbreak Analytics. Its contents are solely the responsibility of the authors and do not necessarily represent the official views of the Centers for Disease Control and Prevention.