JToSentence: Convert a vector to a human readable list

View source: R/strings.R

JToSentenceR Documentation

Convert a vector to a human readable list

Description

Similar to calling 'paste(v, collapse = ", ")' except that the conjuction (" and " by default) is used as the final separator.

Usage

JToSentence(v, sep = ", ", conjunction = " and ")

Arguments

v

Vector of values.

sep

Separator to use between the first elements of the list.

conjunction

Value to use before the last element in the list.

Examples

print(JToSentence(c("apple", "banana", "mandarin", "mango")))
# => [1] "apple, banana, mandarin and mango"


JimMcL/JUtils documentation built on Nov. 7, 2024, 11:25 a.m.