![[Stable]](figures/lifecycle-stable.svg)
extract_initials()
extracts the initials of names in a character
vector.
Usage
extract_initials(x, sep = ". ")
Arguments
- x
A character
vector with names.
- sep
A character
string to separate initials
(Default: ". ").
Value
A character
vector with the initials of
names in x
.
Examples
extract_initials(c("John Doe", "Jane Doe", "John Smith"))
#> [1] "J. D." "J. D." "J. S."
#> [1] "J. D." "J. D." "J. S." # Expected
extract_initials(c("John Doe", "Jane Doe", "John Smith"), sep = ".")
#> [1] "J.D." "J.D." "J.S."
#> [1] "J.D." "J.D." "J.S." # Expected