With one less group / company, R now picks 4 new colors evenly spaced around the color wheel. All but the first are different to the original colors we had for the companies. One way to deal with this in R and ggplot2, is to add a scale. layer to the plot. Here we manually set Hex color values in the scalefillmanual function. Let the left one be the desired color for your palette and make the last color on the right white. Select all the five shapes and open the Color Picker Card by tapping the Color Fill. Then scroll down till the Color Blending section and tap the Blend Horizontally button.
Options(ggplot2.discrete.color = list(c('red', '#af01ef'), custom.colors(99))) Unfortunately it does not take a palette function (like your custom.colors) but it does take a scale function (so you could build one as outlined in @ernestA's answer to produce the warning that you want). Click on a color, then modify the RGB values by copying, for example, the values read in the Digital Color Meter of your Mac while selecting a color (see Using the Digital Color Meter) Or you can click on the Edit button and follow the steps given in the Modifying colors in a palette section.
Color Groups
RColorBrewer is an R packages that uses the work from http://colorbrewer2.org/ to help you choose sensible colour schemes for figures in R. The colors are split into three group, sequential, diverging, and qualitative.
How To Change Color Palette On Research Irs
Sequential – Light colours for low data, dark for high data
Diverging – Light colours for mid-range data, low and high contrasting dark colours
Qualitative – Colours designed to give maximum visual difference between classes
The Palettes
Palettes from RColorBrewer can be displayed with the display.brewer.all() function.
R Commands
How To Change Color Palette On Research Irvine
Palette and color count are selected using brewer.pal(n, name), where name is a character string. The result is a set of hexadecimal codes. Configuration can be confirmed by using display.brewer.pal(n, name).
ggplotCommands
How To Change Color Palette On Research Ireland
The scale commands for ggplot are scale_fill_brewer() and scale_color_brewer().