unglue_sub | R Documentation |
substitute substrings using strings or replacement functions
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. |
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.