powered by
A function that converts a character vector into a list phrase that uses the Oxford comma.
oxford_comma(chr, sep = ", ", final = "or")
A string in the form of a list that has a comma if there are at least three elements in the list (e.g. "a, b, or c")
A character vector to turn into a list phrase (e.g. c("a", "b", "c")).
Separator symbols used to separate the elements in the character vector, Default: ', '
String to use in place of the final separator when we have at least two elements in the character vector, Default: 'or'.
oxford_comma(c("James", "John", "Jeremy")) oxford_comma(c("James", "John", "Jeremy"), final = "and") oxford_comma(c("James", "John")) oxford_comma(c("James"))
Run the code above in your browser using DataLab