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.

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.

make.Z just passes all arguments to elec.data()—it is the same thing. It is the original name of elec.data and is included for legacy and nostalgia reasons.

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")
make.Z( ... )
## 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.
... The collection of arguments that are passed directly to elec.data, or (in the case of print), unused.
x For print(). An elec.data object
n For print(). number of sample precincts to print

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).

Author(s)

Luke W. Miratrix

See Also

See CAST for the CAST method. See tri.calc.sample, tri.sample, and audit.plan.tri 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") )

[Package elec version 0.1 Index]