elec.data {elec} | R Documentation |
core election audit data structure
Description
Makes an object (often called a ‘Z’ object in this documentation) that holds all the vote totals, etc., as well as some precomputed information such as vote margins between candidates, the theoretical winners, and so on.
Usage
elec.data(
V,
C.names = names(V)[2:length(V)],
f = 1,
audit = NULL,
pool = TRUE,
tot.votes.col = "tot.votes",
PID.col = "PID"
)
## S3 method for class 'elec.data'
print(x, n = 4, ...)
Arguments
V |
Voter matrix OR 2-element list with Voter Matrix followed by Candidate names |
C.names |
List of candidate names. Also names of columns in V |
f |
Number of winners |
audit |
The audit data—must have columns that match C.names. Columns are overstatements of votes found for those candidates. |
pool |
Combine small candidates into single pseudo-candidates to increase power |
tot.votes.col |
Name of column that has the total votes for the precincts. |
PID.col |
Name of column that identifies unique PIDs for precincts. |
x |
For print() and is.elec.data(). An elec.data object |
n |
Number to print |
... |
The collection of arguments that are passed directly to elec.data, or (in the case of print), unused. |
Details
elec.data
does some cleaning and renaming of the passed data
structure. In particular it will rename the tot.votes column to "tot.votes"
if it is not that name already.
Value
A “elec.data” data structure. Note: Will add PID (precinct ID) column if no PID provided (and generate unique PIDs). It will rename the PID column to PID. Also, rownames are always PIDs (so indexing by PID works).
print: No return value; prints results.
Author(s)
Luke W. Miratrix
See Also
See CAST.audit for the CAST method. See
tri.calc.sample
for the trinomial bound method. See
countVotes
for counting the votes listed in Z.
Examples
data(santa.cruz)
elec.data( santa.cruz, C.names=c("danner","leopold") )