knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

API and Package

This package extracts data from the web API provided by Valmyndigheten to access the Swedish election results from 2014.

Data

The output is a data frame with either level: landsting, riksdag, or kommun and type of either: kommun or valdistrikt. It shows the top 5 municipalities with the total number of votes for each party.

How to Use

To install package:

install.packages("zoepatton/SwedishElectionData")

To use function:

election_data(level="landsting",type="kommun")

To install and run the corresponding shiny app:

library(shiny)
library(SwedishElectionData)
runGitHub("SwedishElectionData-Shiny","zoepatton")
library(SwedishElectionData)


zoepatton/SwedishElectionData documentation built on Oct. 5, 2020, 6:42 a.m.