Description Usage Arguments Details Examples
This function takes the name of a well-known NYC place and returns the
Geoclient response as a tibble. The place name, and one of either borough
or Zip code are required. The place components can be provided either in
separate vectors as named arguments or with a dataframe and column names
containing each component. The Geoclient API key
can either be provided directly as 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 |
.data |
Dataframe containing columns to be used for other arguments. |
place |
Either a vector of BBLs (numeric or character is accepted), or a bare column name of the bbl field if a dataframe is provided. |
borough |
The name of the borough of the place, 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 place, as either a vector (numeric or character is accepted) or a bare column name of the borough field if a dataframe is provided. Five- and seven-digit Zip codes are accepted. 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 place requests,
interpreting the Geosupport return codes,
the data returned by geo_place
,
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 20 21 22 23 24 | ## Not run:
geoclient_api_key("9d8f7b6wh4jfgud67s89jfyw68vj38fh")
geoclient_place(place = "empire state building", borough = "mn")
library(tibble)
library(dplyr)
df <- tribble(
~place, ~boro, ~zip,
"NYU", NA_character_, "10012",
"CITY HALL", "MN", NA_character_,
"Pospect Park", "Brooklyn", NA_character_
)
geoclient_place(df, place, boro, zip)
df %>%
mutate(
bbl = geoclient_place(place = place, borough = boro, zip = zip)[["bbl"]]
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.