standardize: Standardize names or addresses

Description Usage Arguments Value Examples

Description

This function standardizes things, depending on a dictionary. There are two dictionaries supplied (company_dictionary and address_dictionary), and the user may supply a new one (which is a two column dataframe with columns "word" and "standard").

Usage

1
standardize(text, dictionary)

Arguments

text

A character vector of strings to convert using the dictionary

dictionary

A dictionary of word pairs (word, standard) to convert

Value

A vector of converted strings

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(dplyr)

# company_dictionary is a dataset from this package; may need its own package? nah.
"A.-B. SECURITY LIMITED" %>% standardize(dictionary = company_dictionary)

# is vectorized:
c("A.-B. SECURITY LIMITED", "RNN Sales & R<c3><a9>ntals") %>% standardize(dictionary = company_dictionary))

## Not run: 
br %>% mutate(standardized_name = standardize(name, dictionary = company_dictionary))

## End(Not run)

tweed1e/matchtools documentation built on May 29, 2019, 10:51 a.m.