Description Usage Arguments See Also Examples
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.
1 2 3 | salutation(x)
salutation(x) <- value
|
x |
a name, or vector of names |
value |
a replacement value for x's salutation |
first_name
, middle_name
, last_name
and suffix
for other accessors.
1 2 3 4 5 6 | #Get a salutation
example_name <- "Mr Jim Jeffries"
salutation(example_name)
#Set a salutation
salutation(example_name) <- "Prof"
|
[1] "Mr"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.