Skip to contents

These operators are used to paste objects together as you would with the + operator in Python.

Usage

lhs %P% rhs

lhs %p% rhs

lhs %N% rhs

lhs %C% rhs

lhs %c% rhs

Arguments

lhs

left-hand side

rhs

right-hand side

Value

(character) pasted objects

Examples

"this adds a space" %P% "between strings"
#> [1] "this adds a space between strings"
"this doesn" %p% "'" %p% "t"
#> [1] "this doesn't"
"This skips" %N% "a line" |> cat()
#> This skips
#> a line
"y1" %P% "~" %P% (("x" %p% 1:3) %C% "+") # collapse with space
#> [1] "y1 ~ x1 + x2 + x3"
"y1" %P% "~" %P% (("x" %p% 1:3) %c% "+") # collapse without space
#> [1] "y1 ~ x1+x2+x3"