knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>", 
  fig.width=8, 
  fig.height=6
)

Function Summary

The msand functions:

library(msand)

The Custom Colour Palette I use, palette_msand().

scales::show_col(palette_msand())

The use of theme_msand() and scale_colour_msand() Example.

library(tidyverse)

mtcars %>%
    mutate(am = ifelse(am == 0, "Automatic", "Manual")) %>% 
    ggplot(aes(hp, mpg, colour = am)) +
    geom_point(size = 2.5, alpha = 0.8) +
    scale_colour_msand() +
    theme_msand() +
    labs(title = "Miles Per Gallon vs Horse Power Coloured by Transmission Type",
         x = "Miles Per Gallon",
         y = "Horse Power",
         colour = "Transmission Type")

The use of theme_msand() and scale_fill_msand() Example.

Titanic %>% 
    as_tibble() %>% 
    uncount(n) %>% 
    ggplot(aes(Sex, fill = Survived)) +
    geom_bar(position = "fill") +
    scale_fill_msand() +
    scale_y_continuous(labels = scales::percent_format()) +
    theme_msand() +
    labs(title = "Percent Survived vs Gender",
         x = "Gender",
         y = "Percent")


MichaelSandilands/msand documentation built on Jan. 28, 2023, 8:27 p.m.