Search ZIP codes for a given city within a state

search_city(city_name, state_abb)

Arguments

city_name

Name of major city to search

state_abb

Two-digit code for a U.S. state

Value

tibble of all ZIP code data found for given city

Examples

search_city("Spring Lake", "NJ")
#> # A tibble: 1 × 24
#>   zipcode zipcode_…¹ major…² post_…³ common_c…⁴ county state   lat   lng timez…⁵
#>   <chr>   <chr>      <chr>   <chr>       <blob> <chr>  <chr> <dbl> <dbl> <chr>  
#> 1 07762   Standard   Spring… Spring… <raw 23 B> Monmo… NJ     40.2 -74.0 Eastern
#> # … with 14 more variables: radius_in_miles <dbl>, area_code_list <blob>,
#> #   population <int>, population_density <dbl>, land_area_in_sqmi <dbl>,
#> #   water_area_in_sqmi <dbl>, housing_units <int>,
#> #   occupied_housing_units <int>, median_home_value <int>,
#> #   median_household_income <int>, bounds_west <dbl>, bounds_east <dbl>,
#> #   bounds_north <dbl>, bounds_south <dbl>, and abbreviated variable names
#> #   ¹​zipcode_type, ²​major_city, ³​post_office_city, ⁴​common_city_list, …
search_city("Chappaqua", "NY")
#> # A tibble: 1 × 24
#>   zipcode zipcode_…¹ major…² post_…³ common_c…⁴ county state   lat   lng timez…⁵
#>   <chr>   <chr>      <chr>   <chr>       <blob> <chr>  <chr> <dbl> <dbl> <chr>  
#> 1 10514   Standard   Chappa… Chappa… <raw 21 B> Westc… NY     41.2 -73.8 Eastern
#> # … with 14 more variables: radius_in_miles <dbl>, area_code_list <blob>,
#> #   population <int>, population_density <dbl>, land_area_in_sqmi <dbl>,
#> #   water_area_in_sqmi <dbl>, housing_units <int>,
#> #   occupied_housing_units <int>, median_home_value <int>,
#> #   median_household_income <int>, bounds_west <dbl>, bounds_east <dbl>,
#> #   bounds_north <dbl>, bounds_south <dbl>, and abbreviated variable names
#> #   ¹​zipcode_type, ²​major_city, ³​post_office_city, ⁴​common_city_list, …