In my analysis, each country has its own correlation coefficient that I would like to plot into a worldmap. The correlation coefficient ranges from -1 (should be solid red) to +1 (should be solid blue), with 0 (should be white), and countries with intermediate correlation (e.g., 0.5) should be half white and half blue).
is catMethod and colourPalette set up for such a plot already?
Probably buggy, but it does the job for me. First, I define a function that gives me a palette in the form that rworldmap agrees with me.
This produces
OK, we match the zero value to our very light gray. Add the following now:
this produces
China is the zero in this example.
Buglets:
Australia here has a smaller absolute coefficient (1) than the USA (4), but it gets the full "blue" treatment. The function could be improved to allow for a more symmetric treatment, too.
the color ramp is visually too similar for my taste on the extreme red end. I tried experimenting with bias, but I can't notice a difference. however, because I am colorblind, the problem may be my own and not colorRamp's.