Site icon R-bloggers

NREGA and Indian maps in R

[This article was first published on One Man, One World (ஒரு மனிதன், ஒரு உலகம் ), and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

A few days ago I was reading an article by Jean Drèze and his colleagues on how the first two years of National Rural Employment Guarantee Act (NREGA) has progressed (There was another article by Drèze on NREGA in 2007). The NREGA is empowering the rural people in a radical way:

[ …] NREGA programmes visualise a decisive break with the past. Ever since independence, rural development has largely been the monopoly of local contractors, who have emerged as major agents of exploitation of the rural poor, especially women. Almost every aspect of these programmes, including the schedule of rates that is used to measure and value work done, has been tailor-made for local contractors. These people invariably tend to be local power brokers. They implement programmes in a top-down manner, run roughshod over basic human rights, pay workers a pittance and use labour-displacing machinery.

NREGA is poised to change all that. It places a ban on contractors and their machines. It mandates payment of statutory minimum wages and provides various legal entitlements to workers. It visualises the involvement of local people in every decision — whether it be the selection of works and work-sites, the implementation of projects or their social audit.

After going through the articles I thought about reproducing the color (gray) coded maps. Of course the best tool to do this would be R. It took a few days to figure out how to do this. The rest of the post (hopefully clearly) will be on how to produce an Indian map gray coded with literacy rate of the state.

Now on to the exciting part of producing Indian maps:

The code is straightforward. I adapted the code from http://r-spatial.sourceforge.net/gallery/ more specifically fig14.R there.

#---------------------------------------------------------------------------
# packages for manipulating and mapping spatial data
library(maptools)
# set the working directory
# replace dir with your own path
setwd("dir")
# read the shapefile with the digital boundaries
india <- readShapePoly("india_st")
summary(india)
attributes(india)
# read the literacy file
literacy <- read.csv("literacy.csv")
summary(literacy)

rrt <- literacy$X2001
brks <- quantile(rrt, seq(0,1,1/7), na.rm=T)
cols <- grey(2:(length(brks))/length(brks))
dens <- (2:length(brks))*3

plot(india,col=cols[findInterval(rrt, brks, all.inside=TRUE)])
#---------------------------------------------------------------------------

Here is the output if everything goes fine. Darker shades means dire literacy levels.


To leave a comment for the author, please follow the link and comment on their blog: One Man, One World (ஒரு மனிதன், ஒரு உலகம் ).

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.