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's app ID and key can either be provided directly as arguments, or you can first use geoclient_api_key() to add them to your .Renviron file so they can be called securely without being stored in your code.

geo_address_data(.data, house_number, street, borough = NULL,
  zip = NULL, id = NULL, key = NULL, rate_limit = TRUE)

geo_address(house_number, street, borough = NULL, zip = NULL,
  id = NULL, key = NULL, rate_limit = TRUE)

Arguments

.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.

id

The API app ID provided to you from the NYC Developer Portal formated in quotes. Defaults to NULL and your key is accessed from your .Renviron.

key

The API app key provided to you from the NYC Developer Portal formated in quotes. Defaults to NULL and your key is accessed from your .Renviron.

rate_limit

Whether you would like to limit the rate of API requests in adherence to Geoclient's Service Usage Guidelines. See ?geoclient for more information.

Details

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.

Examples

# NOT RUN { geoclient_api_key("1a2b3c4", "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"]]) # }