Geocoding voter file addresses with coordinates (latitude and longitude) and/or census geographies.
run_geocoder(
voter_file,
geocoder = "census",
parallel = FALSE,
voter_id = "voter_id",
street = "street",
city = "city",
state = "state",
zipcode = "residence_zipcode",
country = NULL,
census_return = NULL,
census_benchmark = "Public_AR_Current",
census_vintage = 4,
census_output = "single",
census_class = "sf",
opencage_key = NULL
)
A data frame contain the voter addresses, separated into columns for street, city, state, and zipcode
The options for selecting geocoders are "censusxy" and "opencage".
TRUE or FALSE. The option to run parallel processing on the data. Running parallel processing requires the user to have at least 4 CPU cores. Use detectCores() to determine the number of CPUs on your device.
the unique identifier
the street number, street name, and/or street suffix. Ex. 555 Main Street SW
the location/town
the abbreviated state (U.S. state categories such as "GA")
the 5 or 9 digit number in the format XXXXX or XXXXX-XXXX.
the abbreviated a nation or territory
either "locations" or "geographies". "locations" returns the latitude and longitude coordinates. "geographies" returns the latitude, longitude, and FIPS codes for county, state, tract, and block.
a dataset of the snapshot of the US Census data. Data is collected two times a year. Public_AR_Current is the time period when we created the snapshot of the data (usually done twice yearly). For example, Public_AR_Current is the most recent snapshot of our dataset.
a dataset that details the survey or census that the census_benchmark uses.
"single" or "full". "single" indicates that only latitude and longitude are returned. "full" indicates that latitude, longitude, and FIPS codes are returned.
"sf" indicates returning a shape file in the R class, sf. Other file types like "json" and "csv" can also be used.
the Opencage Geocoder API key needed to run the Opencage Geocoder. The use of the key is limited to the level of membership on Opencage. Only 2500 rquests per day for free membership.
The geocoded voter file with either added simple (latitude and longitude coordinates) or other geographies.