Description Usage Arguments Value Examples
The NYC.CleanGeoBoro
function utilizes the rGBAT, rUSPS, and rNYCclean packages to clean and geocode NYC addresses by one digit borough code.
1 2 3 | NYC.CleanGeoBoro(in_df, id_colname, addr1_colname,
addr2_colname=NULL, boro_colname, source_cols, geocode_fields,
GBAT_name, in_clus=1, USPS_verify=TRUE)
|
in_df |
a data frame or data table containing NYC addresses. Required. |
id_colname |
the name of the unique identifier column as string. Required. |
addr1_colname |
the name of the input address line one column as string. Required. |
addr2_colname |
the name of the input address line two column as string. Optional. |
boro_colname |
the name of the input one digit borough code as string. Required. |
source_cols |
vector of column names from the input data frame to be returned with geocoder results. Required. |
geocode_fields |
vector of field names generated by the geocoder to be returned with geocoder results. Required. |
GBAT_name |
the release or version of DCP's Geosupport geocoding software as string. Required. |
in_clus |
the number of clusters available to the function as integer. Optional. |
USPS_verify |
if TRUE, addresses will be run through the IBM Infosphere address verification service. Optional. |
A data frame or data table (depending on format of in_df
) of cleaned and geocoded NYC addresses.
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 | # create a data frame of addresses
ADDR <- c("80 CENTRE","125 WORTH S","42 09 28 S","253 BROADW",
"620 ATLANT","125 WOR","1 FRANKLIN","1 FRANKLIN",
"1 1 1 AVE","1 1 1 AVE")
BORO_CODE <- c(1,1,4,1,3,1,3,3,1,1)
u_id <- 1:length(ADDR)
df = data.frame(u_id, ADDR, BORO_CODE)
#specify columns from input data frame to retain
source_cols <- c('u_id')
#specify geocoder return fields
geocode_fields <- c('F1E.output.bin','F1E.output.bbl','F1E.longitude',
'F1E.latitude','JN.ZCTA_10','F1E.output.ret_code','F1E.output.msg')
#clean and geocode by borough code
gc_df <- NYC.CleanGeoBoro(in_df=df,id_colname="u_id",
addr1_colname="ADDR",boro_colname="BORO_CODE",
source_cols=source_cols, geocode_fields=geocode_fields,
GBAT_name="18B")
#preview results
head(gc_df)
#view metadata
NYC.CleanGeoBoro_metadata
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.