Created
March 5, 2011 19:34
-
-
Save ramnathv/856648 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load Data | |
poly = readShapeSpatial('1_data/maps/Precincts.shp'); | |
df = read.csv('1_data/precincts.csv'); | |
# Clean Data | |
df = df[,-grep('count', names(df))]; | |
names(df) = sub('_pct', '', names(df)); | |
# Plot Choropleth | |
choro1 = plotChoropleth(.poly = poly, .df = df, | |
id1 = list('WARD', 'PRECINCT'), | |
id2 = list('ward', 'precinct') | |
field = 'emanuel', | |
title = 'Chicago Mayoral Elections 2011', | |
legtitle = 'Emanuel (% Votes)' | |
colpal = 'Blues', n = 5, style = 'pretty') + | |
opts(legend.position = c(0.25, 0.35))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment