christopherkenny / alarm

ALARM Project Tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

alarm

alarm is an internal ALARM Project package designed to organize and standardize plots and slides for weekly meetings. It is not intended for public use. For packages intended for public use, please see the ALARM Project webiste. For our mapping functions, see ggredist.

Installation

You can install the development version of alarm from GitHub with:

# install.packages("devtools")
devtools::install_github("christopherkenny/alarm")

Creating slides

We have two slide templates, light and dark. To create a new PowerPoint from the templates, use the following.

out_file <- tempfile(fileext = '.pptx')
library(alarm)

alarm_ppt_create(template = 'light') |> 
  print(target = out_file)

alarm_ppt_create() returns an officer object which can be edited using regular officer functions.

Standardize images

We have a theme, color scales, and other related image functions. An example with the dark theme looks like:

ggplot2::mpg |>
  ggplot2::ggplot() +
  ggplot2::geom_point(ggplot2::aes(displ, hwy, color = class)) +
  scale_color_alarm() +
  theme_alarm_dark()

With the light theme, it looks like:

ggplot2::mpg |>
  ggplot2::ggplot() +
  ggplot2::geom_point(ggplot2::aes(displ, hwy, color = class)) +
  scale_color_alarm() +
  theme_alarm_light()

Note: these are used for internal presentations to make the plots match with our slides. For colorblind, publication-ready colors, the ALARM Project primarily uses Cory McCartan’s wacolors package or our ggredist package.

About

ALARM Project Tools


Languages

Language:R 100.0%