enumerate.character: Enumerate Character Vector

View source: R/utils.R

enumerate.characterR Documentation

Enumerate Character Vector

Description

Collapsing a character vector of length n, to a character vector of length 1.

Usage

## S3 method for class 'character'
enumerate(x, ...)

Arguments

x

character vector

...

further arguments passed to or from other methods.

Value

character vector of length 1, with elements separated by a comma except for the last element which is prepended by "and".

Examples

enumerate("apples")
enumerate(c("apples", "oranges"))
enumerate(c("apples", "oranges", "pears"))

litteR documentation built on Aug. 27, 2022, 1:05 a.m.