salt_insert: Insert new characters into some values in a vector

View source: R/salt_insert.R

salt_insertR Documentation

Insert new characters into some values in a vector

Description

Inserts a selection of characters into a percentage of values in the supplied vector.

Usage

salt_insert(x, insertions, p = 0.2, n = 1)

Arguments

x

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

insertions

A shaker function, or a character vector.

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


mdlincoln/salty documentation built on Sept. 3, 2024, 6:50 p.m.