as.data.frame.county: Load the full microdata for a county object

View source: R/county.R

as.data.frame.countyR Documentation

Load the full microdata for a county object

Description

Calls get_county_data() using the county code stored in the object. This is the data counterpart to county_meta(): it converts the lightweight metadata object into the full voter-level data.

Usage

## S3 method for class 'county'
as.data.frame(x, ..., source = NULL)

Arguments

x

A county object (e.g. Lee).

...

Ignored.

source

Character string or NULL. Either a local directory path (e.g. "~/data/") or the base URL of a remote repository. If NULL, the source is resolved automatically (see Details).

Details

To avoid specifying source in every call, set options(data_dir) once at the start of your session or in your .Rprofile:

options(data_dir = "~/my_data/")   # local files
# or leave unset to use the online OSF repository

Value

A data.frame with one row per voter.

See Also

county, county_meta(), get_county_data()

Examples


lee <- as.data.frame(Lee)



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