Skip to contents

[Experimental]

This helper function makes a short list string, e.g. "a, b, ..., z" out of a character vector, e.g. letters.

Usage

h_short_list(x, sep = ", ", thresh = 3L)

Arguments

x

(character)
input which should be listed.

sep

(string)
separator to use.

thresh

(count)
threshold to use, if the length of x is larger then the list will be shortened using the ... ellipsis.

Value

String with the short list.

Examples

h_short_list(letters)
#> [1] "a, b, ..., z"
h_short_list(letters[1:3])
#> [1] "a, b, c"
h_short_list(LETTERS[1:5], sep = ";", thresh = 5L)
#> [1] "A;B;C;D;E"