Learn R Programming

DeducerSpatial (version 0.4)

choro_plot: lifted from choropleth in the USCensus2000 package

Description

lifted from choropleth in the USCensus2000 package

Usage

choro_plot(sp, dem,
    cuts = list("quantile", seq(0, 1, 0.25)), alpha = 0.5,
    main = NULL, sub = "", legend.loc = "bottomleft",
    legend.title = "", add = TRUE, ...)

Arguments

sp
a SpatialPolygonsDataFrame
dem
the variable to map to color
cuts
how to cut dem
alpha
transparency
main
title
sub
subtitle
legend.loc
legend location
legend.title
title
add
add to current plor
...
additional parameters for plot

Examples

Run this code
library(UScensus2000)

lat <- c(43.834526782236814,30.334953881988564)
lon <- c(-131.0888671875  ,-107.8857421875)
southwest <- openmap(c(lat[1],lon[1]),c(lat[2],lon[2]),5,'bing')
data(california.tract)
california.tract <- spTransform(california.tract,osm())

plot(southwest,removeMargin=TRUE)
choro_plot(california.tract,dem = slot(california.tract,"data")[,'med.age'],
		legend.title = 'Median Age',alpha=1)

Run the code above in your browser using DataLab