geoclient_bin: Retrieve Geoclient Response for BINs as a Dataframe

Description Usage Arguments Details Examples

View source: R/geoclient_bin.R

Description

This function takes BINs (Building Identification Number) and returns the Geoclient response as a tibble. The BINs can be provided either in a vector as a named argument or with a dataframe and column name of the BIN field. The Geoclient API's app ID and key can either be provided directly as arguments, or you can first use geoclient_api_keys() to add them to your .Renviron file so they can be called securely without being stored in your code.

Usage

1
2
geoclient_bin(df = NULL, bin, id = NULL, key = NULL, rate_limit = TRUE,
  cap_daily_requests = TRUE)

Arguments

df

Dataframe that contains a column of BINs. Defaults to NULL and bin is taken as a vector.

bin

Either a vector of BINs (numeric or character is accepted), or a bare column name of the bin field if a dataframe is provided.

id

The API app ID provided to you from the NYC Developer Portal formated in quotes. Defaults to NULL and the id 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 the 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.

cap_daily_requests

Whether you would like to cap the daily number 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 BIN requests, interpreting the Geosupport return codes, the data returned by geoclient_bin, and a complete data dictionary for all possible data elements returned by any geoclient function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 

geoclient_api_keys("1a2b3c4", "9d8f7b6wh4jfgud67s89jfyw68vj38fh")

geoclient_bin(bin = 1015862)
geoclient_bin(bin = c("1008760", "1007941"))

library(dplyr)

df <- tibble(BIN = c("1008760", "1007941"))

geoclient_bin(df, BIN)

## End(Not run)

austensen/geoclient documentation built on Jan. 22, 2018, 9:12 p.m.