GBAT.process_addresses: Geocode a large data frame of NYC addresses where there are...

Description Usage Arguments Details Value Examples

View source: R/GBAT.process_addresses.R

Description

The GBAT.process_addresses function is a more efficient way to geocode a large data frame of NYC addresses where there are duplicates. It aggregates, geocodes and then merges the geocoded results back to the original data frame.

Usage

1
2
GBAT.process_addresses(in_df, add_col_name, third_col_name, source_cols,
  geocode_cols, add_type = "boro_code", return_type = "all")

Arguments

in_df

a data frame containing NYC address

add_col_name

the column name of addresses where addresses are in the format of house number and street name (e.g., 123 Smith Street)

third_col_name

the column name of the boro_code or zip_code

source_cols

vector of column names from the input data frame to be returned with geocoder results

geocode_cols

vector of column names generated by the geocoder to be returned with geocoder results

add_type

either boro_code or zip_code

return_type

specify if all records returned or only passes (those that have GRC of 00 or 01)

Details

The New York Department of City Planning's Geosupport Desktop geocoding software must be installed prior to installing the rGBAT16AB package.

Value

The GBAT.process_addresses function can return almost 200 columns which are described in the Geosupport Desktop User Guide

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# create a data frame of addresses
ADDR <- c("448 Lafayette Ave","727 Manhattan Ave","31-00 47th Ave","308 E 78th S","10 Morton St")
ZIP_CODE <- c("11205","11222","11101","10075","10014")
BORO_CODE <- c(3,3,4,1,1)
u_id <- 1:length(ADDR)
df = data.frame(u_id, ADDR, ZIP_CODE, BORO_CODE)

source_cols <- c('u_id')

#preview potential geocode return columns
paste(GC_output$GC_function,GC_output$GC_colname,sep="_")

geocode_cols <- c('F1E_BIN','F1E_BBL','F1E_Longitude','F1E_Latitude')

#geocode data frame
df_gc <- GBAT.process_addresses(df, "ADDR", 'ZIP_CODE', source_cols, geocode_cols, "zip_code","all")

gmculp/rGBAT16AB documentation built on May 14, 2017, 12:58 p.m.