knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
The goal of pollsDK is to make it easy to download and use danish polling data.
You can install pollsDK from github with:
# install.packages("devtools") devtools::install_github("mikkelkrogsholm/pollsDK")
library(pollsDK); library(tidyverse)
The package owes a lot to Erik Gahner whos github repo polls is a plethora of polling data.
get_gahner()
## Collects poll data from Erik Gahners Github g <- get_gahner() glimpse(g)
You can also pull the polls from Berlingske Barometer and Ritzau Index
get_berlingske()
# Get the Berlingske Barometer b <- get_berlingske() glimpse(b)
get_polls()
# Get polls from Berlingske p <- get_polls() glimpse(p)
For both get_polls()
and get_berlingske()
it will pull polls from the current year. You can change that by supplying it with the year argument.
# And even from previous years p14 <- get_polls(2014) glimpse(p14)
get_ritzau()
Ritzau provides a list of data frame with the most recent polls from a select number of pollsters. Each one hase the pollsters number and Ritzaus own index.
# Get Ritzau data r <- get_ritzau() glimpse(r[[1]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.