README.md

dscstyle

Lifecycle:
experimental

The goal of dscstyle is to provide a unified style for the DSC-WAV project.

Installation

You can install the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("DSC-WAV/dscstyle")

DSC Color Palettes

The package dscstyle includes three color palettes that are colorblind friendly and look good with the DSC-WAV logo. These palettes are available in the two ggplot2 scale functions:

These scale functions default to a dark color palette (palette="dark"). There is also a lighter palette option (palette="light") that can be included in these functions, as well as a palette for ordered data (palette="blues").

Dark Palette

Dark Palette

Light Palette

Light Palette

Blues Palette

Blues Palette

DSC ggplot2 Theme

There is also a ggplot2 theme included in the dscstyle package:

This uses the Google font Oswald in to format text. To use this requires the showtext package. While using theme_dsc() will render correctly when knitting to an HTML document, unfortunately, it will not render in the RStudio viewer.

Additionally, you will need to set the chunk option for your plot to include fig.showtext=TRUE.

Example

library(dscstyle)
library(ggplot2)

# Load the Oswald font
sysfonts::font_add_google("Oswald", "Oswald")

ggplot(data = iris, aes(x = Sepal.Length, fill = Species)) + 
  geom_histogram() + 
  theme_dsc() + 
  scale_fill_dsc()
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

Rmarkdown DSC Evaluation Report Template

The dscstyle package also includes a report template to style HTML rendered evaluation reports.

RMD Report

You may need to install the showtext package prior to the first time you use this template. This allows the Oswald Google font to be used in the plots.

This template sets many global knitr options including fig.showtext=TRUE, so that they do not have to be included in each chunk.



zief0002/dscstyle documentation built on June 4, 2020, 9:16 p.m.