Skip to content

R package for poll retrieval from pollofpolls.eu and poll aggregation (trends) calculations

Notifications You must be signed in to change notification settings

petres/pollofpolls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

806448a · Mar 9, 2019

History

12 Commits
Jan 3, 2019
Jan 3, 2019
Jun 6, 2018
Jun 6, 2018
Jan 3, 2019
Jul 10, 2018
Mar 1, 2019
Jun 6, 2018

Repository files navigation

pollofpolls

R package for poll retrieval from https://pollofpolls.eu and poll aggregation (trends) calculations.

Install

The development version can be easily installed with the devtools r-package:

devtools::install_github('https://github.com/petres/pollofpolls.git')

Usage

library(pollofpolls)

# Get overview of all available polls
popGetInfo()

# Read Austrian National Council polls
at = popRead('AT-parliament')
# Plot the polls
plot(at)
plot(at, xlim=as.Date(c('2017-06-01', '2018-06-01')))

# Add trend to polls
at = popAddTrend(at, name='Kalman 0.003', type='kalman', args=list(sd = 0.003))
at = popAddTrend(at, name='Kalman 0.003 Raw', type='kalman', args=list(sd = 0.003), 
                 interpolations=list(lastInterpolation = list()))
plot(at)

# Get description of the functions
?popAddTrend