Learn R Programming

odfWeave (version 0.8.4)

listString: Convert a vector to a textual list

Description

Takes a vector and produces output like "element1 and element2" or "element1, element2 and element3"

Usage

listString(x, period = FALSE, verbose = FALSE)

Arguments

x
a vector (converted to character if not)
period
a logical: should a period end the text?
verbose
a logical: how much details are logged

Value

a character string

Examples

Run this code
listString(letters[1])
listString(letters[1:2])
listString(letters[1:4])

Run the code above in your browser using DataLab