A convenience function to format atomic
vectors as a written list.
listr(x, sep = ", ", conj = " and ", lim = Inf)
atomic
vector.
Separator.
Final separator.
Elements to include in the list. Other elements are abbreviated to " ..."
.
character
.
listr(1:5)
#> [1] "1, 2, 3, 4 and 5"
listr(1:5, sep = "; ")
#> [1] "1; 2; 3; 4 and 5"
listr(1:5, sep = "; ", conj = " and")
#> [1] "1; 2; 3; 4 and5"
listr(1:5, sep = "; ", conj = " and", lim = 2)
#> [1] "1; 2 ..."