choroplotPlan {BARD} | R Documentation |
Plots a shaded thematic map on a plan, based on a set of schore
choroplotPlan(plan,scores,numlevels=5, method=c("quant","equal","absolute"), main="choropleth map", absmin=0,absmax=1,ramplow="blue",ramphigh="red",...)
plan |
plan to plot |
scores |
vector of scores |
method |
binning method |
main |
main title of plot |
numlevels |
number of bins |
absmin |
if method is absolute minimum for absolute range |
absmax |
if method is absolute maximum for absolute range |
ramplow |
color ramp endpoint for negative values |
ramphigh |
color ramp endpoint for positive values |
... |
arguments to pass on to map plotting |
The scores should represent values for each district in the plan. Each score is assigned to one of numlevels
bins. Districts are plotted according to the bin they are assigned to, using a color ramp (or a double color ramp for ranges that extend from negative to positive).
Three methods of bin construction are supported:
- absolute: creates equally spaced bins from absmin
to absmax
- equal: creates equally spaced bins from min(scores)
to max(scores)
- quant: bins are created using quantiles
Nothing. The function is used for printing and plotting effect.
Micah Altman Micah_Altman@harvard.edu http://www.hmdc.harvard.edu/micah_altman/
Scoring functions: calcContiguityScore
suffolk.map <- importBardShape( system.file("shapefiles/suffolk_tracts.shp", package="BARD")) # choose number of districts ndists <- 5 # create some initial plans kplan <- createKmeansPlan(suffolk.map,ndists) choroplotPlan(kplan,calcPopScore(kplan),numlevels=3)