knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
This package extracts data from the web API provided by Valmyndigheten to access the Swedish election results from 2014.
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.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.