ausvotesTR - an R package for exploring Australian federal political donations
r rstats politicsIn my previous job I spent a lot of time analysing political donations for Australian federal elections (don’t ask). To make my life easier I create an R package that scraped all of the data from the Australian Electoral Commission’s (AEC) Transparency Register.
For the last couple of years this package has been sitting dormant in a private git repo, but I was sufficiently motivated this year to dust it off and make it public.1
The package is now available on GitHub. <–more–> A couple of things are worth pointing out. The first one is that this is just a data package (with a couple of convenience functions) and it won’t be any use to you unless you know how to use R. There are some instructions, but they assume you’re familiar with R and you know what you’re doing.
The second is that, while the political finance data is published annually, disclosure entities can submit amendments to their returns throughout the year. This means that unless you’re doing your analysis today, the data you’re using might be out of date. There is an R script included to update the data, which you should do if you’re planning on publishing any analysis with it.
Another caveat is that I used to work on this stuff for a living and had quite a bit of time I could invest in it; these days I’m in a completely different industry and I had a couple of hours to devote to this on my day off. Since I last looked at the data the AEC has made some changes – the main one that stuck out to me is they have remove the address data which had previously been included in the CVS files. I have tried to update the files and the documentation to reflect this change, but I might have missed something.
As I’m no longer working in this area there may be additional changes to the legislation that I haven’t accounted for.
While the AEC does have a facility to download the data, these are just flat CSV files. The advantage this package has over the CSVs (in addition to the data being all nicely organised into data frames) is that the way I have scraped the data for the package has retained a lot of metadata and relationships between the data, which isn’t present in the CSV. That makes it a lot easier to, for example, track a disclosure entity over multiple years despite it changing its name.
Finally, this might be the last time I update this. The Government has indicated that it is going to change the federal political finance system quite significantly, which means it’s likely that the AEC will change their transparency data website. In any case I expect that, if the Government does pass its reforms, the scraping approach I use now will no longer work and if it’s more than a couple of hours to fix it, I’m happy for that to be someone else’s problem.
-
At the federal level in Australia political donations are disclosed annually on the first business day in February. ↩︎