salt_replace | R Documentation |
Inserts a selection of characters into some values of x. Pair salt_replace with the named vectors in replacement_shaker, or supply your own named vector of replacements. The convenience functions salt_ocr and salt_capitalization are light wrappers around salt_replace.
salt_replace(x, replacements, p = 0.1, rep_p = 0.5)
x |
A vector. This will always be coerced to character during salting. |
replacements |
A replacement_shaker function, or a named character vector of patterns and replacements. |
p |
A number between 0 and 1. Percent of values in |
rep_p |
A number between 0 and 1. Probability that a given match should be replaced in one of the selected values. |
A character vector the same length as x
x <- c("Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"Nunc finibus tortor a elit eleifend interdum.",
"Maecenas aliquam augue sit amet ultricies placerat.")
salt_replace(x, replacement_shaker$capitalization, p = 0.5, rep_p = 0.2)
salt_ocr(x, p = 1, rep_p = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.