split_human_name: Split a human full name in its parts

View source: R/clean-text.R

split_human_nameR Documentation

Split a human full name in its parts

Description

Rules:

Usage

split_human_name(data, col = "name")

Arguments

data

dataframe containing a column with a human name

col

string; name of the column containing the name, defaults to name

Details

  • lastname = last word

  • givenname = first word

  • middlename = everything not first word or last word

  • initial = first character

Beware that there will be a warning argument is not an atomic vector; coercing It works nonetheless.

In general it might not be a good idea to try to split a human name, because it's nearly impossible to do that correctly. Mainly works only for Kartoffel names.

Value

dataframe with 4 new colums: lastname, givenname, middlename, initial

See Also

https://shinesolutions.com/2018/01/08/falsehoods-programmers-believe-about-names-with-examples/

Examples

df <- data.frame(name = c("Rita Mae Brown", "vorname df dsafasf", "sdf asdfd"))
split_human_name(df)


cutterkom/kabrutils documentation built on July 3, 2022, 4:04 p.m.