set_color_settings_y2: Setup the color setting for ms charts

View source: R/set_color_settings_y2.R

set_color_settings_y2R Documentation

Setup the color setting for ms charts

Description

Save a frequencies object using freqs(). Provide colors to the set_color_settings function. The colors will be automatically matched to the "label" column of the frequencies or you can manually choose a different column .

Usage

set_color_settings_y2(
  ...,
  dataset = frequencies,
  color_column = label,
  single = FALSE
)

Arguments

...

Colors to use in your ms_chart

dataset

DEFAULT = frequencies; A frequency table named frequencies

color_column

DEFAULT = label; Column from which labels are pulled

single

DEFAULT = FALSE; Set to TRUE when making a single bar chart or when you need just one color.

Examples


add_colors_internal_y2()

frequencies <-
  mtcars %>%
  y2clerk::freqs(
    cyl
  )

set_color_settings_y2(
  BLUE_DARKER,
  BLUE,
  BLUE_LIGHTER
 )

frequencies <-
  mtcars %>%
  dplyr::group_by(
    gear
  ) %>%
  y2clerk::freqs(
    cyl
  )

set_color_settings_y2(
  BLUE_DARKER,
  BLUE,
  BLUE_LIGHTER,
  color_column = group_var
 )

nick-moffitt/y2artisan documentation built on July 30, 2023, 5:40 p.m.