Skip to contents

This function creates a unique 4-letter code for each song title. The generated code is intended for use in displaying song titles in multiple setlist alignment plots, ensuring that each song can be uniquely identified with a concise code.

Usage

create_four_letter_code(title, used_codes)

Arguments

title

A character string representing the song title.

used_codes

A character vector of already used codes to ensure uniqueness.

Value

A character string of length 4 representing the unique code for the song.

Examples

if (FALSE) { # \dontrun{
code <- create_four_letter_code("With or Without You", c())
print(code)  # Output: "WOWY"
} # }