choropleth: Choropleth Mapping

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

A function geared to making choropleth maps easier to construct for the US Census Data.

Usage

1
2
3
4
5
6
7
8
choropleth(sp, dem = "P0010001", 
cuts = list("quantile", seq(0, 1, 0.25)), 
color = list(fun = "hsv", attr = list(h = c(0.4, 0.5, 0.6, 0.7),
 s = 0.6, v = 0.6, alpha = 1)), main = NULL, 
 sub = "Quantiles (equal frequency)", 
 border = "transparent", 
 legend = list(pos = "bottomleft", 
 title = "Population Count"), type = "plot", ...)

Arguments

sp

SpatialPolygonsDataFrame, must be a SpatialPolygonsDataFrame object.

dem

a character string, this must be the name of one of the data.frame objects contained within the SpatialPolygonsDataFrame (e.g. "P0010001").

cuts

a list containing "quantile" and seq object from 0 to 1.

color

a list containing a function and list of arguments for the function to produce the requested color scheme.

main

a character string, this will be the title of the plot.

sub

a character string, this will be the subtitle on the plot.

border

a character string, this selects the border color of the polygons.

legend

a list containing first where to place the legend and second a title for the legend.

type

a character string, can be either "plot" or "spplot".

...

Only arguments available in plot.

Details

choropleth is simply a convenient front end for plot and spplot specifically for use in making quick choropleth maps of US Census data.

Value

a plot or lattice object.

Author(s)

Zack W Almquist

References

Zack W. Almquist (2010). US Census Spatial and Demographic Data in R: The UScensus2000 Suite of Packages. Journal of Statistical Software, 37(6), 1-31. http://www.jstatsoft.org/v37/i06/.

See Also

spplot, plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
data(oregon.county10)

###Using plot
choropleth(oregon.county10,"P0010001",
color = list(fun = "rainbow", 
attr = list(4)),main="2010 Counties \n Oregon",type="plot",border="transparent")



###Using spplot
choropleth(oregon.county10,"P0010001",
main="2010 Counties \n Oregon",border="transparent",type="spplot")

## End(Not run)

UScensus2010 documentation built on May 2, 2019, 5:13 p.m.