stv: Single transferable vote

Description Usage Arguments Value Examples

Description

Single transferable vote

Usage

1
stv(votes, nseats)

Arguments

votes

A list of order-of-preference vote vectors, or a list of ballot objects.

nseats

How many seats to fill.

Value

An STV object, containing:

winners:

the winning entries in order of preference

More to come!

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
votes <- list(
  dex = c("Ice Skating", "Unihoc", "Food"),
  dean = c("Ice Skating", "Unihoc", "Food"),
  paul = c("Whiskey Tasting", "Established"),
  james = c("Ice Skating", "Unihoc", "Food")
)

stv(votes, 2)

map <- c("e", "f", "i", "u", "w")
votes <- list(
  ballot(0, 3, 1, 2, 0, map = map),
  ballot(0, 3, 1, 2, 0, map = map),
  ballot(2, 0, 0, 0, 1, map = map),
  ballot(0, 3, 1, 2, 0, map = map)
)
stv(votes, 2)

DexGroves/avr documentation built on May 6, 2019, 2:12 p.m.