Loading [MathJax]/extensions/MathZoom.js

Tuesday, March 6, 2012

Location of India-Based Contractors on oDesk

My favorite R package, ggplot2, recently introduced enhanced support for choropleth maps. I'd like to make some of these kinds of maps with oDesk data, but as a first step, I thought I'd just plot the locations of all of our India-based contractors by city. In the plot below, dots size as log-scaled by # of contractors reporting that city. The massive light blue dot near Delhi is default coordinate when we're missing the city.

For those of you who know India, anything surprising/interesting here?


Here's the associated R code to make this figure:
library(ggplot2)
library(sqldf)
# using the dataset 'raw' wich is a list of contractors by lat, long
df <- sqldf("SELECT COUNT(*) AS num, LocLat, LocLong
FROM raw GROUP BY LocLat, LocLong")
g <- qplot(LocLong,LocLat, colour=num, size=log(num), data = df)
png("india.png")
print(g)
dev.off()
view raw india.R hosted with ❤ by GitHub