shading: Shading

Description Usage Arguments Value Warning Author(s) See Also Examples

Description

Creates an object of class shading by directly specifying break values and (optionally) colours.

Usage

1
shading(breaks, cols = brewer.pal(length(breaks), "Reds"))

Arguments

breaks

The break points

cols

The shading colours - there should be one more of these than break points.

Value

An object of class shading.

Warning

At the moment, the it is assumed that the number of shading colours is one more than the break points, but this is not checked.

Author(s)

Chris Brunsdon

See Also

choropleth,choro.legend

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@data[,10]/sids@data[,9]
shades = shading(breaks=c(15,30,45,60,75),cols=brewer.pal(6,'YlGn'))
choropleth(sids,sids.rate,shades)
choro.legend(-83.77,37.87,shades,fmt="%4.0f",title='Rate per 10,000')

GISTools documentation built on May 6, 2019, 1:09 a.m.