Test the sensitivity of a result to tactical voting.
Test the sensitivity of a result to tactical voting.
Ballots are added until a specified number of simulated elections ('arep') have been held. If a 'favoured' candidate is specified, then the ballot-box is stuffed with ballots awarding first-preference to this candidate. Alternatively, a 'tacticalBallot' may be specified. If both 'favoured' and 'tacticalBallot' are 'NULL', then a random candidate is selected as the favoured one.
arep: Maximum number of ballot-stuffed elections to run
favoured: Name of the candidate being "plumped". If 'NULL', a random candidate is selected from among the candidates not initially top-ranked. All other candidates are fully-ranked at random, with an identical ballot paper being stuffed multiple times. An integer value for 'favoured' is interpreted as an index into the candidate names.
tacticalBallot: A ballot paper i.e. a vector of length 'ncol(ballots)'. If this argument is non-'NULL', it takes precedence over 'favoured' when the ballot box is being stuffed.
rankMethod: "safeRank" (default), "elected", or "rank". "rank" is a total ranking of the candidates, with ties broken at random. "elected" assigns rank=1 to elected candidates, rank=2 for eliminated candidates.
countMethod: countMethod "stv" (default) or "condorcet"
countArgs: List of args to be passed to countMethod (in addition to votes)
exptName: stem-name of experimental units e.g. "E". If 'NULL', then a 3-character string of capital letters is chosen at random.
equiet: 'TRUE' to suppress all experimental output
everbose: 'TRUE' to produce diagnostic output from the experiment
Returns
A matrix of experimental results, of dimension n by 2m+1, where n is the number of elections and m is the number of candidates. The first column is named "nBallots". Other columns indicate the ranking of the eponymous candidate, and their margin over the next-lower-ranked candidate.
Examples
data(food_election)testAdditions(food_election, arep =2, favoured ="Strawberries", countArgs = list(safety =0))