powered by
Plot levels of a variable in a colour-coded map.
plotmap( values, map, log = FALSE, nclr = 7, include.legend = TRUE, lwd = 0.5, round = 3, brks = NULL, legend = NULL, location = "topright", rev = FALSE )
A map colour-coded to indicate the different levels of values.
values
variable to plot
an object of class SpatialPolygons (See SpatialPolygons-class)
boolean of whether to plot values on log scale
number of colour-levels to use
boolean of whether to include legend
line width of borders of areas
number of digits to round to in legend
if desired, pre-specified breaks for legend
if desired, a pre-specified legend
location of legend
boolean of whether to reverse colour scheme (darker colours for smaller values)
Albert Y. Kim
## Load data data(scotland) map <- scotland$spatial.polygon y <- scotland$data$cases E <- scotland$data$expected SMR <- y/E ## Plot SMR plotmap(SMR, map, nclr=9, location="topleft")
Run the code above in your browser using DataLab