Paste element and add elememt separators.

commaAnd(x, comma = ", ", and = " and ")

Arguments

x

vector of to be coerced to character strings (see paste()).

comma

element separator.

and

last element separator (for 3 elements in x and more).

Examples

commaAnd(c("Judith", "Peter", "Rebecca"))
#> [1] "Judith, Peter and Rebecca"