Hi all,

I ran into a spot of trouble today plotting a map of free and reduced lunch
students (FRL) in Ohio. linked are:
https://drive.google.com/folderview?
id=0ByHQd1ckVHrSTURXeU5MczgzWDQ&usp=sharing

shapefile of school districts in Ohio
csv of the district data

Using the code below I created a choropleth map of Ohio, though the fill in
certain school districts was incorrect. For example: according to my csv of
data Cleveland Municipal would be in the highest bracket of FRL population,
but is not displaying that color. Any thoughts?

#Libraries
library(maps)
library(maptools)
library(RColorBrewer)
library(class)
library(classInt)

#Reading in data
state <- readShapePoly('/Users/Path/to/File/Census2010')
dist <- read.csv('/Users/Path/to/File/Dist.csv', header = T)

#Merging Data
OH <- state
OH@data <-
     merge(OH@data, dist, by.x="NCESID", by.y="NCESID", all.x=F, sort=F )

#Plotting FRL by district
plotvar <- OH@data$PctFRL
nclr <- 5
plotclr <- brewer.pal(nclr, "GnBu")
class <- classIntervals(plotvar, nclr, style = "fixed",
    fixedBreaks = c(0, 0.40, 0.60, 0.80, 0.90, 1))
legend("bottomleft", legend=names(attr(colcode, "table")),
    fill=attr(colcode, "palette"), cex=0.6, bty="n")

Thanks!

	[[alternative HTML version deleted]]

