collapse: collapse

View source: R/collapse.R

collapseR Documentation

collapse

Description

A shortcut of 'paste(x, collapse = y)' for collapsing character vectors into a single string separated by some character. Running 'collapse(c("item 1", "item 2"), sep = " + ")' is identical to running 'paste(c("item 1", "item 2"), collapse = " + ")'.

Usage

collapse(vector, sep = " + ")

Arguments

vector

a vector of character strings. (e.g., 'c("item 1")')

sep

a character string to separate the results. Defaults to " + ".


camkay/panoply documentation built on Jan. 17, 2025, 6:31 a.m.