first_preference_win_regions: Extract first-preference win regions for plotting

Description Usage Arguments

View source: R/first_preference_win_regions.R

Description

In an ordinal voting system, a candidate's "first-preference win region" identifies first-preference shares where that candidate wins the election, given the pattern of lower preferences. Each function below take counts/shares of ballot orderings and returns a data frame with the vertices of each candidate's first-preference win region for a given voting system.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
first_preference_win_regions(
  result,
  split = "",
  method = "plurality",
  if_cycle = "empty",
  s = 0.5
)

positional_first_preference_win_regions(result, split = "", s = 0.5)

rcv_first_preference_win_regions(result, split = "")

condorcet_first_preference_win_regions(result, split = "", if_cycle = "empty")

Arguments

result

The election result specified as a named list of counts or shares for each ballot type, where each name is a (possibly incomplete) ordering of candidates. Examples:

  • list("abc" = 20, "acb" = 4, "bac" = 7, "bca" = 10, "cab" = 8, "cba" = 4, "ab" = 4, "a" = 1)

  • list("Remain > Deal > No deal" = 20, "Remain > No deal > Deal" = 4, etc.)

split

The character by which to split elements of the named list to recover the candidate names.

method

The election method: one of "positional", "Condorcet", "RCV", "plurality", "Borda", "antiplurality".

if_cycle

If method = "Condorcet", specifies how the winner is determined in the event of a Condorcet cycle. The first-preference win regions leave open the cyclic area unless if_cycle is:

  • "kemeny": Kemeny-Young method, i.e. the winner is the candidate who loses by the smallest margin

  • a candidate name (must match a candidate name in result): choose a particular candidate in the event of a cycle

s

If method = "positional", specifies the relative value of a second preference, where a first preference is worth 1 and a third preference is worth 0. Special cases include plurality (s = 0) and Borda count (s = .5).


aeggers/votevizr documentation built on June 4, 2021, 9:10 p.m.