UScensus2010 (version 0.11)

choropleth: Choropleth Mapping

Description

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

Usage

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.

Value

a plot or lattice object.

Details

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

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

Run this code
# 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")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab