Create a single address from parsed components.

pm_rebuild(.data, output, new_address, include_commas = FALSE, include_units = TRUE,
   keep_parsed = "no", side = "right", left_vars, keep_ids = FALSE, locale = "us")

Arguments

.data

An object with raw and parsed data created by pm_rebuild

output

Describes the format of the output address. One of either "full" or "short". A short address contains, at the most, a house number, street directionals, a street name, a street suffix, and a unit type and number. A full address contains all of the selements of a short address as well as, at the most, a city, state, and postal code.

new_address

Optional; name of new variable to store rebuilt address in. If not specified, the re-build addressed will be stored in pm.address.

include_commas

A logical scalar; if TRUE, a comma is added both before and after the city name in rebuild addresses. If FALSE (default), no punctuation is added.

include_units

A logical scalar; if TRUE (default), unit data will be included in the re-constructed address. If FALSE, units will not be included.

keep_parsed

Character string; if "yes", all parsed elements will be added to the source data after replacement. If "limited", only the pm.city, pm.state, and postal code variables will be retained. Otherwise, if "no", only the rebuilt address will be added to the source data (default).

side

One of either "left" or "right" - should parsed data be placed to the left or right of the original data? Placing data to the left may be useful in particularly wide data sets.

left_vars

A character scalar or vector of variables to place on the left-hand side of the output when side is equal to "middle".

keep_ids

Logical scalar; if TRUE, the identification numbers will be kept in the source data after replacement. Otherwise, if FALSE, they will be removed (default).

locale

A string indicating the country these data represent; the only current option is "us" but this is included to facilitate future expansion.

Details

Re-constructed street addresses will can be either "full" or "short" depending on the output parameter's argument. Intersections will always be re-constructed in full.