get_data: extract data

Description Usage Arguments Value Examples

View source: R/get_functions.R

Description

This function extracts the data from a pollyvote container. If the time interval is specified, then the only the data that belongs to the input time interval is returned. Otherwise, whole forecast data is returned.

Usage

1
get_data(pv, time_int = NULL)

Arguments

pv

[pollyvote(1)]
the pollyvote object of which to extract the data from.

time_int[time]

the time interval in which forecast data should be returned. e.g time_int = c("2016-10-31", "2017-11-09")

Value

data frame containing data stored in pv possibly filtered by election_year parameter.

Examples

1
2
3
4
pv = create_pollyvote(perm_countries = "D")
data("polls_individual")
pv = add_data(pv, newdata = polls_individual, country = "D", region = "national", 
              source_type = "poll", election = "BTW")

pollyvote/pollyvoter documentation built on April 4, 2018, 8:18 p.m.