inst/doc/getting-started.R

## ----setup, include = FALSE---------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.width = 7,
  fig.height = 4.5,
  fig.align = "center",
  warning = FALSE,
  message = FALSE
)

## ----install, eval = FALSE----------------------------------------------------
# # install.packages("remotes")
# remotes::install_github("your-org/Rbearcat")

## ----load---------------------------------------------------------------------
library(Rbearcat)
library(ggplot2)

## ----set-geoms----------------------------------------------------------------
set_UC_geoms()

## ----theme-uc-----------------------------------------------------------------
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-hgrid--------------------------------------------------------------
p + theme_UC_hgrid()

## ----theme-vgrid--------------------------------------------------------------
p + theme_UC_vgrid()

## ----theme-nogrid-------------------------------------------------------------
p + theme_UC_nogrid()

## ----theme-options------------------------------------------------------------
p + theme_UC(legend_position = "right")

## ----pal-oi-------------------------------------------------------------------
scales::show_col(palette_OkabeIto, ncol = 4)

## ----pal-oi-light-------------------------------------------------------------
scales::show_col(palette_OkabeIto_light, ncol = 4)

## ----pal-uc-------------------------------------------------------------------
scales::show_col(palette_UC, ncol = 4)

## ----color-scales-------------------------------------------------------------
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()

## ----quarto, eval = FALSE-----------------------------------------------------
# bcat_new_quarto("html")
# bcat_new_quarto("pdf")
# bcat_new_quarto("revealjs", path = "slides/")

Try the Rbearcat package in your browser

Any scripts or data that you put into this service are public.

Rbearcat documentation built on March 21, 2026, 5:07 p.m.