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.
testAdditions(
votes,
ainc = 1,
arep = NULL,
favoured = NULL,
tacticalBallot = NULL,
rankMethod = "safeRank",
countMethod = "stv",
countArgs = list(),
exptName = NULL,
equiet = FALSE,
everbose = FALSE
)
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.
A set of ballots, as in vote_2.3.2
Number of ballots to be added in each step
Maximum number of ballot-stuffed elections to run
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.
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.
"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 "stv" (default) or "condorcet"
List of args to be passed to countMethod (in addition to votes)
stem-name of experimental units e.g. "E". If 'NULL', then a 3-character string of capital letters is chosen at random.
'TRUE' to suppress all experimental output
'TRUE' to produce diagnostic output from the experiment
data(food_election)
testAdditions(food_election, arep = 2, favoured = "Strawberries",
countArgs = list(safety = 0))
Run the code above in your browser using DataLab