I am using ggplot2 to create a choropleth map. I am able to plot the map with different shaded based on the data frame, but I would like to label the state & the number of crimes on the state. I tried geom_text but it keeps saying "Error : geom_text requires the following missing aesthetics: x, y"
This is the code that I have for plotting choropleth
ind <- readShapeSpatial("./IND_adm/IND_adm1.shp")
ind <- fortify(ind, region = "NAME_1")
# read in data frame with number of crimes per Year.
#Plot choropleth map
ggplot(data = crimeSet) +
geom_map(data = crimeSet, aes(map_id = state, fill = yearlyCrimes), map = ind) +
expand_limits(x = ind$long, y = ind$lat) +
scale_fill_gradient2(low = "pink",
mid = "red", midpoint = mid, high = "brown", limits = c(n, m)) +
ggtitle('Total Crimes')
I tried geom_text(data=crimeset,aes(label=state))
but I get the above error