Home

Awesome

This repository contains code to build cosponsorship networks from bills passed in of the Portuguese Parliament .

HOWTO

Replicate by running make.r in R.

The data.r script downloads information on bills and sponsors. Unfortunately, the scraper is highly error-prone, as explained at the top of the script: multiple re-runs are required to successfully collect all bills. All photos should download fine.

See also Ricardo Lafuente's Python scraper for bills, which also runs slowly but is certainly more efficient overall, as well as his listing of Portuguese MPs, which is similar to the one collected by this repository.

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

Sponsors

The sponsors data have multiple rows for each sponsor (one per legislature in which the sponsor sat).

Constituencies are standardized to Wikipedia Português handles (except for "Portuguese outside Europe"), and genders have been checked to ensure that male and female names do not overlap.