
Get vector of colors for observations in one column of a data frame
Source:R/colors.R
get_colors_vctr.RdAssigns one color per unique observed value in dat[[colname]], drawn from
palette starting at color_offset. If the palette is too short,
falls back to get_random_colors(). Factor columns use factor-level order;
other columns use first-observed order.
Arguments
- dat
data frame
- colname
column name in
dat- palette
Character vector of colors to assign. Defaults to
mosuite_palette.- color_offset
integer; number of palette colors to skip before assigning colors to this column's values. Used by
get_colors_lst()to avoid repeating colors across columns with few unique values.