Description Usage Arguments Value Author(s) Examples
View source: R/replace_portion.R
Searches for a pattern in a vector and replaces it with a provided replacement pattern.
1 | replace_portion(invec, find, replace)
|
invec |
The input vector. |
find |
What is the sequence that you're looking for? |
replace |
What do you want to replace the values with? |
A vector the same length as the input vector.
Ananda Mahto
1 2 | x <- c(1, 2, 3, 1, 0, 1, 0, 1, 2, 3, 4, 1, 0, 1)
replace_portion(x, c(1, 0, 1), c(9, 9, 9))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.