printList: Print nice lists

Description Usage Arguments Details Value Author(s) Examples

Description

Generate a list formatted for printing from a vector.

Usage

1
printList(toPrint = letters[1:3], finalSepWord = "and", midSep = ",")

Arguments

toPrint

Vector that you want to turn into a text list.

finalSepWord

The last word to include, defaults to "and" but could be "or" or similar

midSep

Separator between items, defaults to ","

Details

Note that this function includes an Oxford comma.

Value

Character vector of length 1 with the values of toPrint concatenated and separated as specified in the text.

Author(s)

Mark Peterson

Examples

1
2
3
4
5
printList()

printList(LETTERS[1:5])

printList(letters[1:5], "or", ";")

rmdHelpers documentation built on May 1, 2019, 7:33 p.m.