Learn R Programming

podcleaner (version 0.1.2)

utils_remove_address_prefix: Clear undesired address prefixes

Description

Clear address entries in the provided directory dataframe of undesired prefixes such as "depot", "office", "store", "works" or "workshops".

Usage

utils_remove_address_prefix(directory, regex, ignore_case)

Arguments

directory

A directory dataframe with an addresses column.

regex

Regex character string to be use for matching.

ignore_case

Boolean specifying whether case should be ignored (TRUE) or not (FALSE) in search for regex in addresses column entries of directory.

Value

A dataframe.

Examples

Run this code
# NOT RUN {
  directory <- data.frame(
    page = c("71", "71"),
    surname = c("ABOT", "ABRCROMBIE"), forename = c("Wm.", "Alex"),
    occupation = c("Wine and spirit merchant", "Baker"),
    addresses = c(
      "depot -; 1820 London    st. ; house, Mary hill.*",
      "workshop,,12 &;Dixon st.; residence,    Craigrownie, Cove.$   "
    ),
    stringsAsFactors = FALSE
  )
  regex <- globals_regex_address_prefix
  utils_remove_address_prefix(directory, regex, TRUE)
# }

Run the code above in your browser using DataLab