# Data for New Haven to use in example
data(newhaven)
# How many breaches of peace in each census block?
n.breach = poly.counts(breach,blocks)
blocks@data$Count.per <- n.breach/poly.areas(blocks)
# Compute densities and map them
choropleth(blocks,"Count.per")
Run the code above in your browser using DataLab