rcv_tally: Determines RCV round results in a dataframe

Description Usage Arguments Value Examples

View source: R/tabulation.R

Description

Determines RCV round results in a dataframe

Usage

1
rcv_tally(image, rules = c("rcv", "stv"), n_winners = 1, rcvcontest)

Arguments

image

A dataframe containing rcv election data

rules

Currently, either "rcv" (one winner, ranked-choice voting) or "stv" (multiwinner, single transferable vote). Later, options will be available for specific cities' implementations of the STV algorithm. Currently the Droop quota is used for STV, with surplus votes selected randomly for further allocation.

n_winners

default 1. In a multi-winner election (STV), the number of candidates to be elected.

rcvcontest

(optional) The election to calculate results for. If the image contains more than one unique contest, this must be supplied. In most cases except for some San Francisco elections, this is unnecessary.

Value

A dataframe that contains vote tallies

Examples

1
2
rcv_tally(sf_bos_clean, rcvcontest = "Board of Supervisors, District 7")
rcv_tally(cambridge_clean, n_winner = )

ds-elections/rcv documentation built on Feb. 18, 2020, 8:34 p.m.