commasep: List of Items Separated By Commas

View source: R/utiltext.R

commasepR Documentation

List of Items Separated By Commas

Description

Convert the elements of a vector into character strings and paste them together, separated by commas.

Usage

commasep(x, join = " and ", flatten = TRUE)

Arguments

x

Vector of items in the list.

join

The string to be used to separate the last two items in the list.

flatten

Logical value indicating whether to return a single character string (flatten=TRUE, the default) or a list (flatten=FALSE).

Value

A character string (if flatten=TRUE, the default) or a list of character strings.

Author(s)

\adrian

.

Examples

   commasep(letters[1:4])
   y <- commasep(sQuote(letters[1:4]))
   cat(y, fill=TRUE) 

spatstat/spatstat.utils documentation built on Oct. 25, 2023, 10:07 p.m.