str_list: List items

Description Usage Arguments Value Examples

View source: R/str_list.R

Description

str_list() wraps stringr::str_c() in order to turn a list of character strings into a grammatically correct list without an Oxford Comma by default. Sue me.

Usage

1
str_list(string, sep = ", ", last = " and ")

Arguments

string

an object coercible to a character vector.

sep

a string to seperate elements except last.

last

a string to seperate last element.

Value

a character string.

Examples

1
2
shopping_list <- c("bread", "milk", "eggs")
str_list(shopping_list)

tstev/tstevR documentation built on May 18, 2020, 10:57 p.m.