Home

Awesome

This repository contains code to build cosponsorship networks from bills (and motions) passed in the Swedish Parliament.

The data come from the Riksdag's open data portal.

HOWTO

Replicate by running make.r in R.

The data.r script downloads information on bills and sponsors. Once unzipped to the raw folder, the raw JSON data files will take up to 1.5 GB of disk space -- make sure that you have at least that amount of free space on your hard drive.

The build.r script then assembles the edge lists and plots the networks, with the help of a few routines coded into functions.r. Adjust the plot, gexf and mode parameters to skip the plots or to change the node placement algorithm.

DATA

Bills

The sponsors data are read from the JSON dumps available on the Riksdag's open data portal.

Sponsors

The sponsors data are read from the XML listings available on the Riksdag's open data portal.

Note -- missing constituencies are due to a reform of the constituency system, which merged several constituencies into single ones. There are lots of missing constituencies for the legislatures before 2002, 4% (n = 18 constituencies) missing in 2002-2006, and none afterwards.