library(lab5) path <- "2014_riksdagsval_per_valdistrikt.xls"
The package is for the purpose of visualizing the 2014 swedish election results. Provides an interactive shiny app where you can select county and the results for the county. Data is collected from val.se.
Package implements data handling structure, which takes a URL of the form: "2014_electperlocality.xls", where elect = {riksdagsval, landstingsval, kommunval} and locality = {kommun, valdistrikt}
viz <- elect_viz$new(path = path)
Implemented methods are as follows: get_counties() returns a vector of all available counties, used in selection which result to visualize in the Shiny app
head(viz$get_counties())
set_county(val) sets the value of the current county, where val is the county you want to set it to get_county() returns the value of the current county. This is used to select the values you want to plot in the Shiny app
viz$get_county() viz$set_county("Uppsala län") viz$get_county()
get_mean_p_vals() returns a named vector with the mean p-values for the county
viz$get_mean_p_vals()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.