Learn R Programming

afcharts (version 0.5.1)

use_afcharts: Use afcharts defaults.

Description

Set afcharts theme, colour palette and geom aesthetic defaults for ggplot2 charts.

Usage

use_afcharts(
  default_colour = afcharts::af_colour_values["dark-blue"],
  ...,
  reset = FALSE
)

Value

NULL. Function is used for side effects of setting ggplot2 plot theme, colour palette and geom aesthetic defaults.

Arguments

default_colour

Default colour/fill for geoms. Default value is 'blue' from af_colour_values.

...

Arguments passed to theme_af().

reset

Logical. Turn off use_afcharts. This aims to reset the default chart setting to their status when use_afcharts was first called.

Examples

Run this code
library(ggplot2)

d <- subset(mpg, manufacturer == "ford")

ggplot(d, aes(x = model)) + geom_bar()
ggplot(d, aes(x = model, fill = class)) + geom_bar()

use_afcharts()

ggplot(d, aes(x = model)) + geom_bar()
ggplot(d, aes(x = model, fill = class, colour = class)) + geom_bar()

Run the code above in your browser using DataLab