get_color_scale: Create discrete/continuous color scaling for a ggplot2...

Description Usage Arguments Value Author(s)

View source: R/get_color_scale.R

Description

The function can return either a color scale for a discrete variable or a gradient color scale for a continuous numeric variable.

Usage

1
2
3
4
5
6
get_color_scale(
  palette_path,
  scale_title = NULL,
  scale_limits = c(NA, NA),
  discrete = TRUE
)

Arguments

palette_path

A string that sets the file path for an .rds file containing a vector of colors in hexadecimal format..

scale_title

A string that sets the title for the scale's legend. By default the title comes from the variable name assigned to the fill aesthetic.

scale_limits

A numeric vector of length two that sets the limits of the non-discrete scale based on the variable assigned to the fill aesthetic.

discrete

A logical that is TRUE the function returns a discrete color scale. If FALSE, a gradient color scale is returned.

Value

Returns a color scale object that can be attached to ggplot2 plot object for scaling the color aesthetic variable.

Author(s)

Rick Dean


deandevl/RpalettePkg documentation built on Sept. 19, 2021, 8:45 a.m.