SPSS Fill Scale for ggplot2

Description

Applies the SPSS color palette as a discrete fill scale for bar charts, histograms, and other geoms that use the fill aesthetic.

Usage

scale_fill_SPSS(..., version = "modern", direction = 1)

Arguments

Additional arguments passed to ggplot2::discrete_scale().
version Character. “modern” (default) or “legacy”.
direction Integer. 1 for normal order, -1 for reversed.

Value

A ggplot2 discrete scale object.

Examples

library("psych350lab")

library(ggplot2)
ggplot(superman, aes(x = factor(type), fill = factor(type))) +
  geom_bar() +
  scale_fill_SPSS() +
  theme_SPSS(scale.x = "discrete")