Learn R Programming

PCRA (version 1.3.1)

abbreviate_name: Abbreviate a vector of names

Description

Abbreviate a vector of names

Usage

abbreviate_name(name, max_word_length = Inf, collapse = "")

Value

A character vector of abbreviated names.

Arguments

name

A character vector of long character strings.

max_word_length

Maximum word length before truncation.

collapse

A string used to join the abbreviation letters.

Examples

Run this code
abbreviate_name(c("Large Cap Growth", "Small Value"), max_word_length = 3)

Run the code above in your browser using DataLab