Grouped color palette for factors

Usage

subcolor_pal(x, f, h = c(0, 360) + 15, c = 100, l = 65, l.range = 20, h.start = 0, direction = 1, na.value = "grey")

Arguments

x
the vector or factor grouped by f (i.e. Genus)
f
the vector or factor that groups the values of x (i.e. Order)
h
the range of hues to use
c
chroma value to use
l
the base luminance [0,100]
l.range
the luminance above and below the base to use for subcolors
h.start
the starting hue
direction
1=clockwise, 0=counterclockwise around color wheel

Value

a list containing `major`: the base color for each level in f; and `minor`: the color for each item in x

Description

Picks a starting hue for each level of the factor, then returns colors with that hue, but varying luminosity for each item within that factor.