Skip to contents

CRAN status Lifecycle: experimental R-CMD-check

The goal of ucscthemes is to provide branded templates for the University of Cattolica for commonly used R markdown packages. Currently the package contains:

  • Article template for the distill-package
  • Themes for the ggplot2-package
  • Colour and fill scales for the ggplot2-package
  • Course themed skeleton creation based on bs4
  • Presentation template for the xaringan-package 🔜
  • Tutorial template for the learnr-package 🔜
  • Website template for the distill-package 🔜

Installation

You can install ucscthemes from github:

devtools::install_github("NiccoloSalvini/ucscthemes")

Basic usage

xaringan presentation, learnr tutorial and distill article templates with ucsc branding can be access easily using the RStudio IDE, by selecting File -> R markdown ... -> From Template.

Distill website template can be access most easily through the RStudio IDE to create a new project. File -> New project... -> New Directory -> ucsc Distill Website

Previews

ggplot2 branding

The ggplot branding is applied through themes and scales.

library(ucscthemes)
library(ggplot2)

## issue with font theme

ggplot(mtcars, aes(mpg, disp, colour = cyl)) +
  geom_point(size = 5) +
  scale_colour_ucsc(discrete = FALSE) +
  labs(title = "The fonts and colours are ucsc specific",
       subtitle = "and can provide coherent plot branding")+
  theme_ucsc()

ggplot(mtcars, aes(mpg, disp, colour = cyl)) +
  geom_point(size = 5) +
  scale_colour_ucsc(palette = "bw", discrete = FALSE) +
  theme_ucsc_dark() +
  labs(title = "The fonts and colours are ucsc specific",
       subtitle = "and can provide coherent plot branding")

ucsc bs4 course skeleton

This package also offers a way to set up a minimal skeleton infrastructure to reproduce materials for a general course with bs4 and Bookdownan example of a course built with this package.

The function create_course generates the following structure: