Skip to contents

Sets up colors within groups according to separate palettes

Usage

grouped_colors(
  df,
  pal_list,
  pal_direction = rep(1, length(pal_list)),
  colorgroups = NULL,
  colorset = NULL,
  setLimits = NULL
)

Arguments

df

input dataframe

pal_list

list of palettes, or color name or color object that maps to colorgroups, colorset, or scenario. Typically a list of names of palletteer palettes of the same length as unique values in colorgroups

pal_direction

vector of length pal_list, either 1 (default) or -1 (reversed) direction of the palettes

colorgroups

character column name of column defining the groups that define different palettes to use

colorset

character column name of the values to assign colors from those palettes

setLimits

NULL (default) or length-2 numeric vector to force limits of the color scale.

Value

a dataframe with new column color with hex colors