parse_names: Parse Human Names

Description Usage Arguments Value Examples

View source: R/RcppExports.R

Description

human names are complex things; sometimes people have honorifics, or not. Or a single middle name, or many. Or a compound surname, or not a compound surname but 'PhD' at the end of their name, and augh.

parse_names provides a simple function for taking consistently formatted human names and splitting them into salutation, first_name, middle_name, last_name and suffix. It is capable of dealing with compound surnames, multiple middle names, and similar variations, and is fully vectorised.

Usage

1

Arguments

names

a character vector of names to parse.

Value

a data.frame with the columns salutation, first_name, middle_name, last_name, suffix and full_name (which contains the original name). In the event that a name doesn't have a salutation, middle name, suffix, or so on, an NA will appear.

Examples

1
2
3
4
5
# Parse a simple name
parse_names("Oliver Keyes")

# Parse a more complex name
parse_names("Hon. Oliver Timothy Keyes Esq.")

humaniformat documentation built on May 2, 2019, 6:42 a.m.