salt_swap | R Documentation |
Because swaps
can be provided by either a character vector or a function
that returns a character vector, salt_swap
can be fruitfully used in
conjunction with the charlatan::charlatan package to intersperse real data with
simulated data.
salt_swap(x, swaps, p = 0.2)
x |
A vector. This will always be coerced to character during salting. |
swaps |
Values to be swapped out |
p |
A number between 0 and 1. Percent of values in |
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.")
new_values <- c("foo", "bar", "baz")
salt_swap(x, swaps = new_values, p = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.