handle_region_method: Adds new column named 'electoral_result' in the input...

Description Usage Arguments Value

View source: R/initial_pollyvote_functions.R

Description

Adds new column named 'electoral_result' in the input [data] parameter depending on the value of [region_method] parameter.

Usage

1
handle_region_method(data, region_method)

Arguments

data

[dataframe]
The predictions dataframe

region_method

[character(1)] Values:

  • [character(1)] wta: Winner takes it all method - 1 is assigned to the party which has most points in a region for a given day.

  • [character(1)] vs: Voteshares method - percent for the parties remain unchanged.

Value

dataframe with 'electoral_result' column which a result of applying region aggregation method.


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