%+% | R Documentation |
Many programming languages utilize +
as a means of
concatenating strings. In standard R, however, +
will
return an error when used with strings. %+%
provides
this ability for parsimonious string concatenation.
lhs %+% rhs
lhs |
The left-hand side. |
rhs |
The right-hand side. |
By default, it uses paste0
under the
hood, but this can be shifted to paste
by running
options(infixit.paste = "paste0")
. By default (as with
paste
), this will have the seperator be a single space
(" "
) between the pasted objects. This behavior can be
changed with the infixit.paste_sep
option. E.g.,
options(infixit.paste_sep = "|")
A string pasting the rhs to the lhs.
{
b <- "An additional sentence."
"This is a sentence. " %+% b
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.