calc_coalitions: Coalitions percentage prediction. Provides prediction of...

Description Usage Arguments Value

Description

Coalitions percentage prediction.

Provides prediction of percentages from different source types for specified coalitions. Coalitions percentages are predicted for each day in range [election_day - limit_days, election_day).

Usage

1
2
3
calc_coalitions(pv, coalitions, threshold = 0, threshold_handle = "omit",
  prediction = "pollyvote", ..., election_year = NULL,
  permitted_parties = NULL, limitdays = -1, for.ggplot2 = FALSE)

Arguments

pv

[pollyvote]
The pollyvote object of which to get the prediction from.

coalitions

[list]
List of vectors representing coallitions. Coallitions must be specified with full and exact party names.

threshold

[numeric(1)]
If positive, indicates the minimum voice component that a party has to reach in order to participate in a coalition.

threshold_handle

[character(1)]
Specifies how to handle coalitions with parties that have less percentage than threshold. Options:

  • 'omit': default value. In this case, this coalition percentage is not calculated for the given date. Instead, NA is entered.

  • 'ignore': In this case, the coalition will be made up of the remaining parties.

prediction

[character(1)]
Name of the prediction function. For calculation of coalitions aggregated over (date, source_type, party) [pollyvote] should be supplied. For calculation of coalitions aggregated over (region, date, source_type, party) [aggr_pollyvote_region] should be supplied. For calculation of coalitions only in one region [pollyvote_region] should be supplied. Options:

  • [character(1)]: Single component name (e.g., "poll"); in this case will one column for the specified component and one column each (direct) Subcomponent returned.

  • [character(n)]: Vector with component names - gives exactly for the specified components (without automatic subcomponent addition) the values back.

  • [NULL]: Wildcard that returns all components.

...

Optional parameters passed into [prediction] function.

election_year

[numeric(1)]
The election year for which the coalitions are predicted. If not specified, the most recent election year is used.

permitted_parties

[character(n)]
Selection of only specific parties for which coalitions are calculated. Options:

  • [NULL]: Default value for not excluding any party in coalitions calculations.

  • [character(1)]: For specifying one party.

  • [character(n)]: Vector for specifying multiple parties.

for.ggplot2

[logical(1)]
Return format of coalitions predictions. Options:

  • [logical(1)] FALSE: Default value - Function returns data frame of columns (date | Days to election | Coalition_1_percentage | ... | Coaltion_n_percentage)

  • [logical(1)] TRUE: Data frame with rows containing visualisation points

limit_days

[numeric(1)]
Limit in days before the election up to which the coalitions percentages are calculated. For example, specifying limitdays = 100 return coalitions percentages up to 100 days before the election. If negative number is supplied (default value of -1), then data from all days is taken into account when calculating coalition percentages.

Value

dataframe of columns (date | Days to election | Coalition_1_percentage | ... | Coaltion_n_percentage) or visualisation points of the coalitions prediction.


pollyvote/pollyvoter documentation built on May 25, 2019, 11:23 a.m.