#' @title Discrete colour scales for SCS
#'
#' @param palette Name of palette to use from `scs_colour_palettes`; e.g. main,
#' sequential, focus.
#' @param reverse Boolean value to indicate whether the palette should be
#' reversed
#' @param ... Additional arguments passed to scale type
#'
#' @examples
#' library(ggplot2)
#' qplot(mpg, wt, data = mtcars, colour = as.factor(cyl)) +
#' scale_colour_discrete_scs()
#'
#' @export
scale_colour_discrete_scs <- function(palette = "main",
reverse = FALSE,
...) {
ggplot2::discrete_scale("colour",
paste0("scs_", palette),
palette = scs_palette(palette,
reverse),
...)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.