Learn R Programming

coalitions (version 0.6.12)

get_surveys: Scrape surveys from all pollsters

Description

Given a specific date, extract the survey from this date or the last one before this date.

Usage

get_surveys(country = c("DE", "AT"))

get_surveys_by()

get_surveys_nds()

get_surveys_saxony()

get_surveys_brb()

get_surveys_thuringen()

get_latest(surveys = NULL, max_date = Sys.Date())

Arguments

country

Choose country from which surveys should be scraped. Currently "DE" (Germany) and "AT" (Austria) are supported.

surveys

If provided, latest survey will be obtained from this object, otherwise calls get_surveys.

max_date

Specifies the date, relative to which latest survey will be searched for. Defaults to Sys.Date.

Examples

Run this code
# NOT RUN {
library(coalitions)
# scrape data for the German federal election
# get_surveys()
# }
# NOT RUN {
library(coalitions)
### Scrape the newest poll for the German federal election
# Possibility 1: Calling get_latest without arguments scrapes surveys from the web
# Possibility 2: Use get_latest() on an already scraped dataset
surveys <- get_latest(surveys_sample)
# }

Run the code above in your browser using DataLab