address_cleaner: A general address cleaner.

Description Usage Arguments Details Value Examples

View source: R/address_cleaner.R

Description

Performs character transformations on a vector of addresses in order to build "web-safe" URLs for the Google API.

Usage

1
address_cleaner(address, verbose = TRUE)

Arguments

address

A raw 1xN vector of UTF-8 encoded addresses. Note: these addresses should be in raw form, not URL encoded (e.g., of the form: 123 Main Street, Somewhere, NY 12345 USA)(country is optional but recommended).

verbose

Displays additional progress output

Details

This function scrubs a vector of addresses (e.g., a vector of the form: address, city, state, postal code, country) of character values that may inhibit sucessful geocoding with the Google maps API. Specifically, address_cleaner:

Note: We recommend reviewing the output of this function against the original vector to ensure the transformations it performs resolve the formatting issues (if any) found in your source data.

Value

address_cleaner returns a character vector of addresses of the same length as the input.

Examples

1
2
3
4
5
6
# Clean an incompatible vector of addresses
address <- c(" 1600 Pennsylvania Ave NW <c2><bd>, Washington, DC 20500, USA ",
			 "  <c2><aa>1600  Amphitheatre Pkwy,  Mountain View, CA 94043, USA")

# View the return:
address_cleaner(address)

DerekYves/r_geo_code documentation built on May 6, 2019, 2:10 p.m.