printList {rmdHelpers}R Documentation

Print nice lists

Description

Generate a list formatted for printing from a vector.

Usage

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

printList()

printList(LETTERS[1:5])

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

[Package rmdHelpers version 1.3.1 Index]