rggplot2plotpaletterworldmap

Locate value "0" in the center of the Palette in a world map


I am currently analysing the effect of certain indexes over world countries (134). This effect ranges from (-1.01, 0.528). Given that "effect = 0" is located to the right of the Palette, it does not coincide with the change between greens and yellows and therefore the map is misleading.

Any clue?

Thank you

Note: The video I have followed to work with this code is here https://www.youtube.com/watch?v=8dNBWESwcHU

The code and the plot I have obtained is the following:

# set the colour
colourPalette <- RColorBrewer::brewer.pal(10,'Spectral') 
# plot the info in the world map ("world_data" is my dataset)
mapCountryData(world_data,
               nameColumnToPlot = 'index_effect',
               catMethod = 'fixedwidth',
               mapRegion = 'world',
               colourPalette = 'diverging',
               numCats = 10)

enter image description here


Solution