get_fill_scale: Create discrete/continuous fill scaling for a ggplot2...

Description Usage Arguments Value Author(s)

View source: R/get_fill_scale.R

Description

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

Usage

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

Arguments

palette_path

A string that sets the file path for the .rds file that contains a vector of colors in hexadecimal format. Argument is required.

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 if TRUE the function returns a discrete fill scale. If FALSE, a gradient fill scale is returned.

Value

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

Author(s)

Rick Dean


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