I was attempting to follow a tutorial to create a bubble plot of school district proficiency rates.
Data
shapefile of school districts (Census2010.shp)
Code
reading in data
dist <- read.csv('/Users/Path/to/District.csv', header = T)
state <- readShapePoly('/Users/Path/to/Census2010')
merge shapefile and district data
GA <- state
GA@data <-
merge(GA@data, dist, by.x="NCESID", by.y="NCESID", all.x=T, sort=F )
creating bubble plot
plotvar <- GA@data$CCRPI
nclr <- 8
plotclr <- brewer.pal(nclr,"PuRd")
max.symbol.size=12
min.symbol.size=1
class <- classIntervals(plotvar, nclr, style="quantile") #Some school districts did not report data
colcode <- findColours(class, plotclr)
symbol.size <- ((plotvar-min(plotvar))/
(max(plotvar)-min(plotvar))*(max.symbol.size - min.symbol.size) + min.symbol.size)
plot(GA)
GA.cntr <- coordinates(GA)
points(GA.cntr, pch=16, col = colcode, cex = symbol.size)
points(GA.cntr, cex = symbol.size)
Though the resulting map is just hollow school district outlines. What am I missing here?