collapse: Paste and collapse.

Description Usage Arguments Details Value Examples

Description

Concatenate strings, possibly interspersing them with another string.

Usage

1
collapse(..., inter = "")

Arguments

...

Objects to be pasted and collapsed.

inter

[character] String with which to intersperse the result. Defaults to an empty string.

Details

paste0(..., collapse="") takes a little more space than collapse(...), though if the result is to be interspersed with something, the difference becomes merely one character: paste0(..., collapse="_") vs collapse(..., inter="_").

Value

[character] The collapsed string.

Examples

1
2
tmp <- c ("i", "am", "a", "sample", "vector")
identical (soundcorrs:::collapse(tmp), paste0(tmp,collapse=""))

soundcorrs documentation built on Nov. 16, 2020, 5:09 p.m.