Provides R functions and templates for plotting and reporting analyses using DGI Clinical company colours.
# install.package("devtools")
remotes::install_github("taylordunn/dgitheme")
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.