README.md

dgitheme

Provides R functions and templates for plotting and reporting analyses using DGI Clinical company colours.

Installation

# install.package("devtools")
remotes::install_github("taylordunn/dgitheme")

Usage

Reference the documentation with ?dgi_pal, ?dgi_colors and ?scale_color_dgi.

To visualize the color palettes:

scales::show_col(dgi_pal()(3))
scales::show_col(dgi_pal("official")(6))

To return the character hex codes as a vector:

dgi_colors("teal")

ggplot(mtcars, aes(hp, mpg, color = factor(cyl))) +
  geom_point(size = 4) +
  scale_color_manual(values = dgi_colors("teal", "light grey", "black")) +
  theme_minimal()

There are also convenience ggplot2 scale functions:

ggplot(mtcars, aes(hp, mpg, color = factor(cyl))) +
  geom_point(size = 4) +
  scale_color_dgi() +
  theme_minimal()

To create a new RMarkdown document with useful defaults: File -> New File -> R Markdown -> From Template -> DGI RMarkdown Report Template.

Palettes



taylordunn/dgitheme documentation built on March 10, 2020, 5:01 p.m.