rwmGetColours: to choose map colours for classified data

Description Usage Arguments Value

View source: R/rwmGetColours.R


Returns a vector of colours based upon the palette specified and number of colours specified. If colourPalette specifies a number of colours and this is different from numColours, numColours takes precedence and colours are interpolated to make the number fit.


rwmGetColours(colourPalette, numColours)



string describing the colour palette to use, choice of:

  1. "palette" for the current palette

  2. a vector of valid colours, e.g. =c('red','white','blue') or output from RColourBrewer

  3. one of "heat", "diverging", "white2Black", "black2White", "topo", "rainbow", "terrain", "negpos8", "negpos9"


the number of colour categories desired


A vector specifiying a number of colours.

rworldmap documentation built on May 19, 2017, 3:30 p.m.

Search within the rworldmap package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.