Learn R Programming

diyar (version 0.5.1)

listr: Grammatical lists.

Description

A convenience function to format atomic vectors as a written list.

Usage

listr(x, sep = ", ", conj = " and ", lim = Inf)

Value

character.

Arguments

x

atomic vector.

sep

Separator.

conj

Final separator.

lim

Elements to include in the list. Other elements are abbreviated to " ...".

Examples

Run this code
listr(1:5)
listr(1:5, sep = "; ")
listr(1:5, sep = "; ", conj = " and")
listr(1:5, sep = "; ", conj = " and", lim = 2)

Run the code above in your browser using DataLab