R: Collapse vector to string.

collapse {BBmisc} | R Documentation

## Collapse vector to string.

### Description

A simple wrapper for `paste(x, collapse)`.

### Usage

    collapse(x, sep = ",")

### Arguments

`x` | [`vector`] Vector to collapse.
`sep` | [`character(1)`] Passed to `collapse` in `paste`. Default is “,”.

### Value

[`character(1)`].

### Examples

    collapse(c("foo", "bar"))
    collapse(c("foo", "bar"), sep = ";")

[Package BBmisc version 1.11 Index]