invert_name: Inverts a surname name to name surname (or vice versa)

Description Usage Arguments Value Examples

View source: R/invert_name.R

Description

Inverts a surname name to name surname (or vice versa)

Usage

1
2
invert_name(name, sep = " ", position = 1, to_title = FALSE,
  out_sep = " ")

Arguments

name

The name to invert.

sep

The separator of the name.

position

Integer separating the given name from the last name.

to_title

Should the result be converted to title? (John Doe instead of john doe)

out_sep

The separator for the output.

Value

A string with the surname and name inverted

Examples

1
2
3
4
5
6
name <- "RODRIGUES BRUNO"
invert_name(name)
invert_name(name, to_title = TRUE)
invert_name("Bruno.Rodrigues", sep = "\\.")
invert_name("Bruno.Rodrigues", sep = "\\.", out_sep = " ")
invert_name("John Middlename Doe", sep = " ", position = 2)

b-rodrigues/brotools documentation built on April 21, 2020, 2:27 p.m.