knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.width = 7, fig.height = 4.5, fig.align = "center", warning = FALSE, message = FALSE )
Rbearcat is a University of Cincinnati R package for Econometrics and Data Science. It provides: - UC-branded ggplot2 themes and official UC color scales, plus colorblind-friendly alternatives - Publication-quality tables for regression, summary statistics, and correlation matrices - Plot wrappers for common chart types (bar, line, scatter, histogram, box, coefficient, diagnostics, time series, area) - Number formatters for inline reporting (dollar, percent, comma, scientific, date, p-value) - RMarkdown and Quarto templates for UC-branded documents and presentations
Install from GitHub:
# install.packages("remotes") remotes::install_github("your-org/Rbearcat")
library(Rbearcat) library(ggplot2)
Rbearcat ships with four ggplot2 themes. Each applies UC styling with official
UC red accents, Bearcats Black text, and light neutral gridlines.
set_UC_geoms() optionally sets default geom colors for the session.
set_UC_geoms()
theme_UC() - the defaultBoth horizontal and vertical gridlines with an outer panel border.
p <- ggplot(iris, aes(Petal.Width, Petal.Length, color = Species)) + geom_point(size = 2) + labs(title = "Iris: Petal Width vs Length", subtitle = "Default UC Theme", x = "Petal Width", y = "Petal Length") p + theme_UC()
theme_UC_hgrid() - horizontal gridlines onlyBest for bar charts where horizontal gridlines aid value reading.
p + theme_UC_hgrid()
theme_UC_vgrid() - vertical gridlines onlyBest for horizontal bar charts and coefficient plots.
p + theme_UC_vgrid()
theme_UC_nogrid() - no gridlinesClean look for diagnostic panels or dense multi-panel layouts.
p + theme_UC_nogrid()
All themes accept legend_position ("bottom" or "right") and
legend_hide (TRUE/FALSE).
p + theme_UC(legend_position = "right")
Rbearcat includes three named palettes. palette_UC contains the official UC
primary and expanded brand colors used throughout the package.
scales::show_col(palette_OkabeIto, ncol = 4)
A lighter variant is also available:
scales::show_col(palette_OkabeIto_light, ncol = 4)
scales::show_col(palette_UC, ncol = 4)
Use scale_color_UC() / scale_fill_UC() inside any ggplot for the default UC
expanded palette. scale_color_OkabeIto() and scale_fill_OkabeIto() remain
available when you want a dedicated colorblind-friendly alternative.
ggplot(iris, aes(Sepal.Length, fill = Species)) + geom_density(alpha = 0.7) + scale_fill_UC() + labs(title = "Density Plot with UC Fill Scale") + theme_UC_hgrid()
Create a UC-branded Quarto document in your working directory:
bcat_new_quarto("html") bcat_new_quarto("pdf") bcat_new_quarto("revealjs", path = "slides/")
vignette("tables") for regression, summary, and correlation
tablesvignette("plots") for all nine plot functionsvignette("formatting") for inline number formattersAny scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.