Learn R Programming

afcharts (version 0.4.1)

scale_colour_discrete_af: Discrete colour scales for Analysis Function plots

Description

Discrete colour scales for Analysis Function plots

Usage

scale_colour_discrete_af(
  palette = "main",
  palette_type = c("af"),
  reverse = FALSE,
  ...
)

Value

ggplot2 discrete colour scale

Arguments

palette

Name of palette to use; e.g. "main", "sequential", "focus." Default value is "main".

palette_type

Currently only the Analysis Function palettes are supported. Defaults to "af".

reverse

Boolean value to indicate whether the palette should be reversed.

...

Additional arguments passed to scale type.

Examples

Run this code
library(ggplot2)
library(dplyr)

economics_long %>%
  filter(variable %in% c("psavert", "uempmed")) %>%
  ggplot(aes(x = date, y = value, colour = variable)) +
  geom_line(linewidth = 1) +
  scale_colour_discrete_af()

Run the code above in your browser using DataLab