choropleth

Share:

Description

Draws a choropleth map given a spatialPolygons object, a variable and a shading scheme.

Usage

1

Arguments

sp

A spatialPolygons or spatialPolygonsDataFrame object.

v

The variaqble to be mapped. Must have the same number of elements as s has polygons.

shading

A shading scheme created by shading or auto.shading.

...

Additional parameters to be passed on to the plot method for sp.

Details

The function returns no value, but draws a choropleth map on the current graphics device as a side effect.

Value

None (see above).

Author(s)

Chris Brunsdon

See Also

choro.legend, auto.shading, shading.

Examples

1
2
3
4
5
6
7
# Read in map data and compute a rate for mapping
sids <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1], 
	proj4string=CRS("+proj=longlat +ellps=clrk66"))
sids.rate=10000*sids$SID74/sids$BIR74
# Create the shading scheme,  plot a choropleth map 
shades = auto.shading(sids.rate,cols=brewer.pal(5,'Blues'))
choropleth(sids,sids.rate,shades)