added file "faction_colors.csv" to data folder (serves as input for function)
added function get_faction_color that takes either faction_id or abbreviation (of faction) as input and returns a named character vector with hex color code (and either faction_id or abbreviation as name)
another idea was to add a function that creates a vector which serves as input for ggplot2'sscale_fill_manual/scale_color_manual, but it is not necessary since get_faction_color can either generate new columns that are named characters and are thus easily accessible
get_faction_color
that takes either faction_id or abbreviation (of faction) as input and returns a named character vector with hex color code (and either faction_id or abbreviation as name)ggplot2's
scale_fill_manual/scale_color_manual
, but it is not necessary sinceget_faction_color
can either generate new columns that are named characters and are thus easily accessible2 sample workflows:
dplyr::mutate
scale_fill_manual
call: