Description Usage Arguments Examples
substitute substrings using strings or replacement functions
1 | unglue_sub(x, patterns, repl, open = "{", close = "}")
|
x |
character vector |
patterns |
a character vector or a list of character vectors, if a list,
items will be pasted using an empty separator ( |
repl |
function to apply on matched substrings, formula (if package rlang is installed), substring, or named list of such. |
open |
The opening delimiter. |
close |
The closing delimiter. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | unglue_sub(
c("a and b", "foo or bar"),
c("{x} and {y}", "{x} or {z}"),
"XXX")
unglue_sub(
c("a and b", "foo or bar"),
c("{x} and {y}", "{x} or {z}"),
toupper)
unglue_sub(
c("a and b", "foo or BAR"),
c("{x} and {y}", "{x} or {z}"),
list(x= "XXX", y = toupper, z = tolower))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.