county: The county class

countyR Documentation

The county class

Description

A county object is a lightweight metadata summary for a single county's ballot data file. It does not contain the microdata itself (one row per voter); it only stores precomputed statistics about that county's races, used to build help pages and to give a quick overview before downloading the full dataset.

Details

One such object exists per county (e.g. Lee), stored as a small package data object. Use county_meta() to retrieve one by county code, or get_county_data() / as.data.frame() to load the actual microdata.

Structure

A county object is a named list with the class attribute c("county", "list") and the following elements:

county

Character. The county code (e.g. "Lee").

n_voters_total

Integer. Total number of voters (rows) in the county's microdata file, regardless of eligibility in any particular race.

n_precincts_total

Integer. Total number of distinct precincts in the county.

elections

Character vector. Race codes present in this county's data file (a subset of election_catalog).

voters_by_election

Named integer vector. Number of eligible (non-NA) voters for each race in elections.

precincts_by_election

Named integer vector. Number of precincts with at least one eligible voter, for each race.

options_by_election

Named list of character vectors. The vote options observed in the data for each race (candidate codes or combinations, plus "A"/"I" when present).

See Also

Lee, county_meta(), get_county_data(), list_counties(), election_catalog


eiballots documentation built on Sept. 26, 2026, 5:06 p.m.