Skip to content

Tag: interactive maps

Visualizing left-right government positions

How does the political landscape of Europe change over time? One way to approach this question is to map the socio-economic left-right positions of the governments in power. So let’s plot the changing ideological  positions of the governments using data from the Manifesto project! As you will see below, this proved to be a more challenging task than I imagined, but the preliminary results are worth sharing nonetheless. First, we need to extract the left-right positions from the Manifesto dataset. Using the function described here, this is straightforward: lr2000<-manifesto.position(‘rile’, start=2000, end=2000) This compiles the (weighted) cabinet positions for the European countries for the year 2000. Next, let’s generate a static map. We can use the new package rworldmap for this purpose. Let’s also build a custom palette that maps colors to left-right values. Since in Europe red traditionally is the color of the political left (the socialists), the palette ranges from dark red to gray to dark blue (for the right-wing governments). library (rworldmap) op <- palette(c(‘red4′,’red3′,’red2′,’red1′,’grey’,’blue1′, ‘blue2′,’blue3’, ‘blue4’)) After recoding the name of the UK, we are ready to bind our data and plot the map. You can save the map as a png file. library(car) lr2000$State<-recode(lr$State, “‘Great Britain’=’United Kingdom'”) lrmapdata <- joinCountryData2Map( lr2000,joinCode = “NAME”, nameJoinColumn = “State”, mapResolution=’medium’) par(mai=c(0,0,0.2,0),xaxs=”i”,yaxs=”i”) png(file=’LR2000map.png’, width=640,height=480) mapCountryData( lrmapdata, nameColumnToPlot=”position”,colourPalette=op, xlim=c(-9,31), ylim=c(36,68), mapTitle=’2000′, aspect=1.25,addLegend=T ) dev.off() The limits on on the x- and y-axes center the map on Europe. It is a process of trial and error till you get it right, and…