knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

CRAN_Status_Badge

pollsDK

The goal of pollsDK is to make it easy to download and use danish polling data.

Installation

You can install pollsDK from github with:

# install.packages("devtools")
devtools::install_github("mikkelkrogsholm/pollsDK")

Load library

library(pollsDK); library(tidyverse)

Gahner

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)

Berlingske and Ritzau

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]])


56north/pollsDK documentation built on May 5, 2019, 11:27 a.m.