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

operator_add

Concatenate Two Character Vectors


Description

Binary operators for joining (concatenating) two character vectors, with a typical R look-and-feel.

Usage

e1 %s+% e2

e1 %stri+% e2

Arguments

e1

a character vector or an object coercible to a character vector

e2

a character vector or an object coercible to a character vector

Details

Vectorized over e1 and e2.

These operators act like a call to stri_join(e1, e2, sep=''). However, note that joining 3 vectors, e.g., e1 %s+% e2 %s+% e3 is slower than stri_join(e1, e2, e3, sep=''), because it creates a new (temporary) result vector each time the operator is applied.

Value

Returns a character vector.

See Also

Examples

c('abc', '123', 'xy') %s+% letters[1:6]
'ID_' %s+% 1:5

stringi

Character String Processing Facilities

v1.6.1
file LICENSE
Authors
Marek Gagolewski [aut, cre, cph] (<https://orcid.org/0000-0003-0637-6028>), Bartek Tartanus [ctb], and others (stringi source code); IBM, Unicode, Inc. and others (ICU4C source code, Unicode Character Database)
Initial release
2021-05-05

We don't support your browser anymore

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