Awesome
This repository contains code to build cosponsorship networks from bills passed in the Hungarian Parliament.
HOWTO
Replicate by running make.r
in R.
The data.r
script downloads information on sponsors only: you will need to download the raw bill indexes manually, because I was too lazy to get a grip of the dynamic URL generation scheme to scrape only five pages. Recent versions of the files are included in the repository for convenience.
The procedure to get the bill indexes manually is as follows:
- Go to this index of all legislation.
- Click the first legislative cycle.
- Set "Típus" to "törvényjavaslat".
- Click "Lekérdezés" to get the index.
- Save and repeat for each cycle.
The files go into raw/bill-lists
. The filenames should be of the form 1998-2002
or of the form 2014-
for the ongoing legislature. The zipped version of the files included in the repository will expand to the right filenames and folder hierarchy.
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
legislature
-- legislature yearsref
-- bill id (of the form "T/123")url
-- URLtitle
-- short titleauthors
-- sponsors list, as text, or "GOV" for government billsstatus
-- bill status (always lezárt, closed)n_au
-- total number of sponsors
Sponsors
The sponsors data has one row per legislature in which the sponsor sat.
legislature
-- legislature yearsurl
-- profile URL, shortenedname
-- name (in Western order, cleaned up from "Dr." titles)photo
-- photo dummy (0/1), to indicate if a sponsor photo existsparty
-- party affiliation, abbreviatedpartyname
-- party affiliation, full name (in Hungarian)sex
-- gender (F/M), imputed from first namesmandate
-- number of years in office when legislature started (int)constituency
-- constituency, stored as the string to its Wikipedia English entry