Description Usage Arguments Details Value Examples
View source: R/element_mutate.R
Mutate elements of a string
1 | element_mutate(x, index, mutations)
|
x |
character string. |
index |
vector containing the positions of the elements to be replaced. |
mutations |
vector containing the replacements. |
This function allows one to replace the characters of a given string at certain positions with new characters. In case the string is binary, the default replacement is just the negation of the bits at each desired locations.
A character string with changes specified by the user at desired positions.
1 2 3 4 5 6 7 | ## Not run:
# For a binary string
element_mutate("1001", c(1,2,3,4))
# For a non-binary string:
element_mutate("abcd", c(1,2), c("b","a"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.