Description Usage Arguments Details Examples
View source: R/geo_blockface.R
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. 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 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | geo_blockface_data(
.data,
on_street,
cross_street_1,
cross_street_2,
borough,
cross_street_1_borough = NULL,
cross_street_2_borough = NULL,
compass_direction = NULL,
key = NULL,
rate_limit = TRUE
)
geo_blockface(
on_street,
cross_street_1,
cross_street_2,
borough,
cross_street_1_borough = NULL,
cross_street_2_borough = NULL,
compass_direction = NULL,
key = NULL,
rate_limit = TRUE
)
|
.data |
Dataframe containing columns to be used for other arguments. |
on_street |
The street of the target blockface, as either a vector of street names, or a bare column name of the field if a dataframe is provided. |
cross_street_1 |
The first cross street of the blockface, as either a vector of street names, or a bare column name of the field if a dataframe is provided. |
cross_street_2 |
The second cross street of the blockface, as either a vector of street names, or a bare column name of the field if a dataframe is provided. |
borough |
The name of the borough of the "on street", as either a vector or a bare column name of the borough field if a dataframe is provided. |
cross_street_1_borough |
Optionally, the name of the borough of the
first cross street, as either a vector or a bare column name of the borough
field if a dataframe is provided. By default this is |
cross_street_2_borough |
Optionally, the name of the borough of the
second cross street, as either a vector or a bare column name of the
borough field if a dataframe is provided. By default this is |
compass_direction |
Optionally, the direction indicating a side of the
street to request information about only one side of the street. The
argument can be provided as either a vector or a bare column name of the
field if a dataframe is provided. The valid values of are |
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 blockface requests,
interpreting the
Geosupport return codes,
the data returned by geo_blockface
,
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 25 26 27 | ## Not run:
geoclient_api_key("1a2b3c4", "9d8f7b6wh4jfgud67s89jfyw68vj38fh")
geo_blockface(
on_street = "cypress ave",
cross_street_1 = "dekalb ave",
cross_street_2 = "hart st",
borough = "qn"
)
df <- tibble::tribble(
~street, ~cross1, ~cross2, ~boro,
"macdougal st", "washington sq s", "w 3rd st", "mn",
"Cypress Ave", "DeKalb Ave", "Hart St", "Brooklyn"
)
geo_blockface_data(df, street, cross1, cross2, boro)
library(dplyr)
bind_cols(df, geo_blockface_data(df, street, cross1, cross2, boro))
mutate(df, traffic_dir = geo_blockface(street, cross1, cross2, boro)[["trafficDirection"]])
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.