comma_list {pkgcond}R Documentation

Construct a comma separated list

Description

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

Usage

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

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


[Package pkgcond version 0.1.1 Index]