salty (version 0.1.0)

salt_substitute: Substitute certain characters in a vector

Description

Substitute certain characters in a vector

Usage

salt_substitute(x, substitutions, p = 0.2, n = 1)

Arguments

x

A vector. This will always be coerced to character during salting.

substitutions

Values to be substituted in

p

A number between 0 and 1. Percent of values in x that should be salted.

n

A positive integer. Number of times to add new values from insertions into selected values in x manually supply your own list of characters.

Value

A character vector the same length as x

Examples

Run this code
# NOT RUN {
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_substitute(x, shaker$digits, p = 0.5, n = 5)
# }

Run the code above in your browser using DataLab