Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

str_collapse

Collapse Strings


Description

Collapse multiple strings into a single string.

Usage

str_collapse(str, sep = ", ", quote = character(), n = Inf, ellipsis = "[...]")

Arguments

str

(character())
Vector of strings.

sep

(character(1))
String used to collapse the elements of x.

quote

(character())
Quotes to use around each element of x.

Will be replicated to lenght 2.

n

(integer(1))
Number of elements to keep from x. See utils::head().

ellipsis

(character(1))
If the string has to be shortened, this is signaled by appending ellipsis to str. Default is " [...]".

Value

(character(1)).

Examples

str_collapse(letters, quote = "'", n = 5)

mlr3misc

Helper Functions for 'mlr3'

v0.10.0
LGPL-3
Authors
Michel Lang [cre, aut] (<https://orcid.org/0000-0001-9754-0393>), Patrick Schratz [aut] (<https://orcid.org/0000-0003-0748-6624>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.