toStr: Convert a vector to a character string

View source: R/toStr.R

toStrR Documentation

Convert a vector to a character string

Description

Similar to toString but with additional parameters for more flexibility.

Usage

toStr(x, join_word = "and", quote = FALSE, oxford_comma = FALSE)

Arguments

x

A vector to be converted.

join_word

(character) The word to use between the two last item. Default is 'and'. Set to NULL to omit.

quote

(logical) Whether to add single quotes around each word.

oxford_comma

(logical) Whether to use an oxford comma. Default FALSE. Ignored if and set to FALSE.

Value

A character string.

Examples

toStr(letters[1:3])
toStr(1:5)

salix-d/salixUtils documentation built on Aug. 14, 2024, 7:11 a.m.