Description Usage Arguments Details Examples
This function takes components of addresses and returns the Geoclient
response as a tibble. The house number, street name, and one of either
borough or Zip code are required. The address components can be provided
either in separate vectors as named arguments or with a dataframe and column
names containing each component. If your address data is not easily separted
into these components you can use geo_search()
with the full address as a
string. The Geoclient API key can either be provided directly an
argument, or you can first use geoclient_api_key()
to add it to your
.Renviron
file so it can be called securely without being stored in your
code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
.data |
Dataframe containing columns to be used for other arguments. |
house_number |
The house number of the address, as either a vector of numbers (numeric or character is accepted), or a bare column name of the number field if a dataframe is provided. |
street |
The street name of the address, as either a vector of names, or a bare column name of the number field if a dataframe is provided. |
borough |
The name of the borough of the address, as either a vector or a bare column name of the borough field if a dataframe is provided. The borough is only required if Zip code is not provided. |
zip |
The Zip code of the address, as either a vector (numeric or character is accepted) or a bare column name of the borough field if a dataframe is provided. The Zip code is only required if borough is not provided. |
key |
The API key provided to you from the NYC Developer Portal
formated in quotes. Defaults to |
rate_limit |
Whether you would like to limit the rate of API requests in
adherence to Geoclient's Service Usage Guidelines. See |
For more details see the Geoclient Documentation's guide to making address requests,
interpreting the Geosupport return codes, the
data returned by geo_address
,
and a complete data dictionary for
all possible data elements returned by any geoclient function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run:
geoclient_api_key("9d8f7b6wh4jfgud67s89jfyw68vj38fh")
geo_address("139", "MacDougal St", "MN")
df <- tibble::tribble(
~num, ~st, ~boro, ~zip,
"139", "MacDougal St", "manhattan", "11231",
"295", "Lafayette street", NA_character_, "10012-2722",
"40", "WASHINGTON SQ S", "MN", NA_character_
)
geo_address_data(df, num, st, boro, zip)
dplyr::mutate(df, bbl = geo_address(num, st, boro, zip)[["bbl"]])
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.