listify: Turn vectors into lists with any specified linking word

View source: R/listify.R

listifyR Documentation

Turn vectors into lists with any specified linking word

Description

Turn vectors into lists with any specified linking word

Usage

listify(items, linking_word = "and", oxford_comma = FALSE)

Arguments

items

A vector of items to turn into a list phrase (e.g. c("a", "b", "c")).

linking_word

Defaults to "and". Can be anything.

oxford_comma

logical. Defaults to FALSE. If TRUE, an oxford comma is added (e.g. "a, b, and c").

Value

A string in the form of a list (e.g. "a, b and c")

Examples

listify(c("a", "b", "c"), "or")


verbaliseR documentation built on Sept. 21, 2022, 9:10 a.m.