comma_list: Construct a comma separated list

Description Usage Arguments Examples

View source: R/comma_list.R

Description

Use this utility to create nicely formatted lists for error messages and the like.

Usage

1
comma_list(x, sep = ", ", sep2 = " and ", sep.last = ", and ", terminator = "")

Arguments

x

a list that can be converted into a character.

sep

the typical separator

sep2

the separator to use in the case of only two elements.

sep.last

the separator to use between the last and next to last elements when there are at least 3 element in the list.

terminator

concatenated to the end after the list is concluded.

Examples

1
2
3
comma_list(c("you", "I"))
comma_list(c("you", "I"), sep2=" & ")
comma_list(head(letters), sep.last=', ', term=', ...')

pkgcond documentation built on April 28, 2021, 9:06 a.m.