val2014: The 'val2014' Reference Class

Description Value Fields Methods Examples

Description

A Reference Class to calculate the 2014 Swedish election results for all counties. It calls the Valmyndigheten API, reads the semi-colon separated values file, extracts all the votes for each party in every municipality, and calculates the percentage of votes for each political party in every county. These results are stored in the respective county name field.

Value

A val2014 class generator object.

Fields

Blekinge

Blekinge county

Dalarna

Dalarna county

Gotland

Gotland county

Gavleborg

Gavleborg county

Halland

Halland county

Jamtland

Jamtland county

Jonkoping

Jonkoping county

Kalmar

Kalmar county

Kronoberg

Kronoberg county

Norrbotten

Norrbotten county

Skane

Skane county

Stockholm

Stockholm county

Sodermanland

Sodermanland county

Uppsala

Uppsala county

Varmland

Varmland county

Vasterbotten

Vasterbotten county

Vasternorrland

Vasternorrland county

Vastmanland

Vastmanland county

vastergotland

Vastra Gotaland county

Orebro

Orebro county

Ostergotland

Ostergotland county

Methods

county(county)

Returns a named vector with percent values of all political parties for a given county.

initialize()

Calls the Valmyndigheten API to get the 2014 election results of all municipality, then calculating all the election results for every county and storing them in this object.

Examples

1
2
val = val2014()
print(val$county("Blekinge"))

amemem/lab5package documentation built on Dec. 19, 2021, 1:39 a.m.