Learn R Programming

censusxy (version 0.1.2)

cxy_geocode: Geocode Addresses Using the Census Bureau Geocoder

Description

This is the single function of the censusxy package, allowing for the easy geocoding of US Addresses using the US Census Bureau Geocoder. This function allows for flexible input and virtually unlimited batch sizes. See the vignette vignette(censusxy) for more details

Usage

cxy_geocode(.data, address, city, state, zip,
    style = "minimal", output = "tibble", timeout = 30)

Arguments

.data

Data frame or tibble containing address data

address

Column name containing address

city

Optional; column name containing city

state

Optional; column name containing state

zip

Optional; column name containing 5-digit zip code

style

One of either "minimal" or "full"

output

One of either "tibble" or "sf"

timeout

Maximum number of minutes for each API call to the geocoder.

Value

Either a tibble or sf object containing the census geocoder response.

Examples

Run this code
# NOT RUN {
# load sample data
data <- stl_homicides_small

# geocode data
data <- cxy_geocode(data, address = "street_address", city = "city",
    state = "state", zip = "postal_code")

# preview data
data
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab