Plot Levels of a Variable in a Colour-Coded Map

Description

Plot levels of a variable in a colour-coded map.

Usage

1
2
plotmap(values, map, log = FALSE, nclr = 7, include.legend = TRUE, lwd = 0.5, 
round = 3, brks = NULL, legend = NULL, location = "topright", rev = FALSE)

Arguments

values

variable to plot

map

an object of class SpatialPolygons (See SpatialPolygons-class)

log

boolean of whether to plot values on log scale

nclr

number of colour-levels to use

include.legend

boolean of whether to include legend

lwd

line width of borders of areas

round

number of digits to round to in legend

brks

if desired, pre-specified breaks for legend

legend

if desired, a pre-specified legend

location

location of legend

rev

boolean of whether to reverse colour scheme (darker colours for smaller values)

Value

A map colour-coded to indicate the different levels of values.

Author(s)

Albert Y. Kim

See Also

mapvariable

Examples

1
2
3
4
5
6
7
8
9
## 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")

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.