Specifying US Census Geography Vintage #161
-
Loving the package! However, I need to call the Census 2010 Vintage instead of the most recent one and I haven't seen documentation on how to do that with the geo function. Is it possible? The Census Geocoder Documentation states "you need to select a benchmark (time period) and select a vintage of geography." so I'm hoping the package incorporates it. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @cymonegates, yes you can pass the library(tidygeocoder)
geo('1600 Pennsylvania Ave NW Washington, DC',
method = 'census',
custom_query = list(vintage = "Public_AR_Census2010 "),
full_results = TRUE,
verbose = TRUE
)
#>
#> Number of Unique Addresses: 1
#> Passing 1 address to the US Census single address geocoder
#>
#> Number of Unique Addresses: 1
#> Querying API URL: https://geocoding.geo.census.gov/geocoder/locations/onelineaddress
#> Passing the following parameters to the API:
#> address : "1600 Pennsylvania Ave NW Washington, DC"
#> vintage : "Public_AR_Census2010 "
#> format : "json"
#> benchmark : "Public_AR_Current"
#> HTTP Status Code: 200
#> Query completed in: 2.1 seconds
#>
#> Query completed in: 2.1 seconds
#> # A tibble: 1 x 18
#> address lat long matchedAddress tigerLine.tiger~ tigerLine.side
#> <chr> <dbl> <dbl> <chr> <chr> <chr>
#> 1 1600 Pennsyl~ 38.9 -77.0 1600 PENNSYLVANIA A~ 76225813 L
#> # ... with 12 more variables: addressComponents.fromAddress <chr>,
#> # addressComponents.toAddress <chr>, addressComponents.preQualifier <chr>,
#> # addressComponents.preDirection <chr>, addressComponents.preType <chr>,
#> # addressComponents.streetName <chr>, addressComponents.suffixType <chr>,
#> # addressComponents.suffixDirection <chr>,
#> # addressComponents.suffixQualifier <chr>, addressComponents.city <chr>,
#> # addressComponents.state <chr>, addressComponents.zip <chr> Created on 2022-02-15 by the reprex package (v2.0.1)
|
Beta Was this translation helpful? Give feedback.
Hi @cymonegates, yes you can pass the
vintage
parameter directly to the Census API. You can do this with thecustom_query
parameter ingeo()
(orgeocode()
) like this: