View source: R/set_color_settings_y2.R
set_color_settings_y2 | R Documentation |
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 .
set_color_settings_y2(
...,
dataset = frequencies,
color_column = label,
single = FALSE
)
... |
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. |
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
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.