clean: clean function

Description Usage Arguments Details Value See Also Examples

View source: R/clean.R

Description

Function to clean the column to be used in joining. Will remove certain parts of elements in a column

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
clean(
  df,
  column,
  replacement = "",
  selected = NULL,
  prefixes = FALSE,
  suffixes = FALSE,
  switch_order = FALSE,
  ignore.case = FALSE
)

Arguments

df

A table the column is in

column

The column to be cleaned

replacement

What the cleaned portion of elements will be changed to, Default: ”

selected

Characters to removed, Default: NULL

prefixes

If true, prefixes will be removed, Default: FALSE

suffixes

If true, suffixes will be removed, Default: FALSE

switch_order

Should be set to True if one of the columns is Last Name First and the other is not. Will change the order of names. Ignore if you not joining by names, Default: FALSE

ignore.case

If true, will ignore capitalization, Default: FALSE

Details

This should be run prior to fuzzy_match as it will ensure a higher degree of accuracy.

Value

Will return a table which has specified characters removed from the column

See Also

is.boolean unfactor

Examples

1
2
3
4
5
## Not run: 
congress <- clean(congress, name, selected = ",", prefixes = T, suffixes = T)
politwoops <- clean(politwoops, full_name, selected = ",", prefixes = T, suffixes = T)

## End(Not run)

hkarp1/fuz.merge documentation built on Sept. 2, 2020, 12:05 a.m.