Prepping for my R maps workshop

I’m thoroughly enjoying gathering data and writing the scripts for the maps I’m going to share in my upcoming Women in Tech Summit workshop. I’m starting with world-level maps, then will move to US and then more local. A main challenge is that there are lots of different ways to draw maps in R. My personal favorite is to use ggplot2. I have seen there is a choroplethr package, but I haven’t tried that yet.

Here’s my latest map:

WmGov

It’s based on the wrld_simpl SpatialPolygonsDataFrame, and I merged in data from the World Bank Development Indicators. Next up: gender differences in economic and education outcomes across the US. Whee!

making maps in R

This map plots grocery stores with at least 30 employees, as of 2008. The map begins with a black and white Google terrain map and plots locations by latitude and longitude coordinates. I am working on getting more current data, but I can say that the food deserts haven’t changed much.

phlgrocer2008

Here’s the code I used. This requires the ggmap library.

qmap(“philadelphia”, zoom = 12, maptype=”terrain”, color=”bw”) +
geom_point(data=grocer, aes(x=long, y=latitude), colour=”blue”, alpha=.9,
size=4) +
labs(x=””, y=””, title=”Large Grocery Stores in 2008″) +
theme(plot.title = element_text(size=rel(1.8), face=”bold”, vjust=1.5,
family=”Times”), axis.ticks=element_blank(), axis.text.x=element_blank(),
axis.text.y=element_blank())