Skip to contents

The word 'and' is inserted before the last element and an Oxford comma is used.

Usage

paste_oxford_list(x)

Arguments

x

a list or vector

Value

a string where each element in x is separated by a comma

Author

Pat Schloss pschloss@umich.edu

Kelly Sovacool sovacool@umich.edu

Examples

paste_oxford_list(1:3)
#> [1] "1, 2, and 3"
paste_oxford_list(c("cats", "dogs", "turtles"))
#> [1] "cats, dogs, and turtles"