Learn R Programming

humaniformat (version 0.6.0)

salutation: Get or set a name's saltation

Description

as in the lubridate package, individual components of a name can be both extracted or set using the relevant function call - see the examples. In the event that you attempt to set a component to NA, no modification will be made; in the event that you try to get a component that isn't present, an NA will be returned.

Usage

salutation(x)
salutation(x) <- value

Arguments

x
a name, or vector of names
value
a replacement value for x's salutation

See Also

first_name, middle_name, last_name and suffix for other accessors.

Examples

Run this code
#Get a salutation
example_name <- "Mr Jim Jeffries"
salutation(example_name)

#Set a salutation
salutation(example_name) <- "Prof"

Run the code above in your browser using DataLab