trades_clean_directory: Mutate operation(s) in Scottish post office trades directory...

Description Usage Arguments Value Examples

View source: R/trades.r

Description

Attempts to clean the provided Scottish post office trades directory data.frame.

Usage

1
trades_clean_directory(directory, progress = TRUE, verbose = FALSE)

Arguments

directory

A Scottish post office trades directory in the form of a data.frame or other object that inherits from the data.frame class such as a tibble. Columns must at least include forename, surname, occupation``address.trade.number and address.trade.body.

progress

Whether progress should be shown (TRUE) or not (FALSE).

verbose

Whether the function should be executed silently (FALSE) or not (TRUE).

Value

A data.frame of the same class as the one provided in directory; columns include at least forename, surname, occupation, address.trade.number and address.trade.body. Entries are cleaned of optical character recognition (OCR) errors and subject to a number of standardisation operations.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
pages <- rep("71", 2L)
ranks <- c("135", "326")
surnames <- c("ABOT", "ABRCROMBIE")
forenames <- c("Wm.", "Alex")
occupations <- c(
  "Wine and spirit mercht - See Advertisement in Appendix.", "Bkr"
)
types <- rep("OWN ACCOUNT", 2L)
numbers <- c("1S20", "I2")
bodies <- c("Londn rd.", "Dixen pl")
directory <- tibble::tibble(
  page = pages, rank = ranks, surname = surnames, forename = forenames,
  occupation = occupations, type = types,
  address.trade.number = numbers, address.trade.body = bodies
)
trades_clean_directory(directory, progress = TRUE, verbose = FALSE)

podcleaner documentation built on Jan. 12, 2022, 1:06 a.m.