string_operators: String operators

%+%R Documentation

String operators

Description

String operators to concatenate vectors that are coercible to character strings. Vector arguments are recycled as needed.

Usage

x %+% y

x %+ % y

x %+_% y

x %+-% y

Arguments

x

a vector coercible to a character string

y

a vector coercible to a character string

Value

A vector of concatenated strings.

Examples

## Concatenate two strings
'fish' %+% 'sticks'

## Concatenate a numeric and string
1 %+% '1'

## Concatenate two character vectors
letters[1:5] %+% letters[1:5]

## Concatenate two strings with white space between
'hello' %+ % 'world'

## Concatenate two character vectors with white space between
letters[1:5] %+ % letters[1:5]

## Concatenate two strings with an underscore between
'hello' %+_% 'world'

## Concatenate two character vectors with an underscore between
letters[1:5] %+_% letters[1:5]

## Concatenate two strings with a dash between
'hello' %+-% 'world'

## Concatenate two character vectors with a dash between
letters[1:5] %+-% letters[1:5]

jasenfinch/jfmisc documentation built on Feb. 21, 2024, 7:10 a.m.