Re-index colors for grouped data, as displayed in plots and other widgets, when groups may be missing.

color_indexer(x, clrby)

Arguments

x

a data frame.

clrby

column name of the grouping variable to be used for coloring.

Value

a re-indexed vector of colors from tolpal.

Details

This is typically used when group levels are in a data set but user selection (mouse brush action) in an interactive plot may not result in a data subset that includes data from all levels of the grouping variable.

Examples

# not run